0

Enable saving from the PDF plugin if the user go into annotation mode.

Do not bother with the extra effort of trying to detect the case of the
user going into annotation mode and then not making any edits. Just
assume they likely will to keep the state machine simpler.

BUG=936094

Change-Id: I82a793e39f7175c5bffdb3c93630f9b085385dca
Reviewed-on: https://chromium-review.googlesource.com/c/1490397
Reviewed-by: dstockwell <dstockwell@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#635787}
This commit is contained in:
Lei Zhang
2019-02-27 01:02:29 +00:00
committed by Commit Bot
parent f36d4cb3ea
commit d86f770e18

@ -673,6 +673,10 @@ void OutOfProcessInstance::HandleMessage(const pp::Var& message) {
}
const bool force = dict.Get(pp::Var(kJSForce)).AsBool();
if (force) {
// |force| being true means the user has entered annotation mode. In which
// case, assume the user will make edits and prefer saving using the
// plugin data.
pp::PDF::SetPluginCanSave(this, true);
SaveToBuffer(dict.Get(pp::Var(kJSToken)).AsString());
} else {
SaveToFile(dict.Get(pp::Var(kJSToken)).AsString());