diff options
author | tsergeant <tsergeant@chromium.org> | 2015-09-22 23:54:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-23 06:55:20 +0000 |
commit | bf5a8f6f14f9efe010a1fb7380440ed776984cc9 (patch) | |
tree | 1970fcf805ca2ef407d76feef564ba2c3256cb85 /pdf/out_of_process_instance.cc | |
parent | b52c507ecb15e3eaf6051cba0de0cbaf69fe200a (diff) | |
download | chromium_src-bf5a8f6f14f9efe010a1fb7380440ed776984cc9.zip chromium_src-bf5a8f6f14f9efe010a1fb7380440ed776984cc9.tar.gz chromium_src-bf5a8f6f14f9efe010a1fb7380440ed776984cc9.tar.bz2 |
PDF: Prevent left/right arrow shortcuts when a PDF text field is focused.
This fixes an issue where pressing left or right while editing a form
would change page as well as move the caret.
BUG=490004
Review URL: https://codereview.chromium.org/1359613002
Cr-Commit-Position: refs/heads/master@{#350322}
Diffstat (limited to 'pdf/out_of_process_instance.cc')
-rw-r--r-- | pdf/out_of_process_instance.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc index 3478b78..cfa11ba 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc @@ -144,6 +144,10 @@ const char kJSNamedDestinationPageNumber[] = "pageNumber"; const char kJSSetIsSelectingType[] = "setIsSelecting"; const char kJSIsSelecting[] = "isSelecting"; +// Notify when a form field is focused (Plugin -> Page) +const char kJSFieldFocusType[] = "formFocusChange"; +const char kJSFieldFocus[] = "focused"; + const int kFindResultCooldownMs = 100; const double kMinZoom = 0.01; @@ -1264,6 +1268,12 @@ void OutOfProcessInstance::DocumentLoadProgress(uint32 available, void OutOfProcessInstance::FormTextFieldFocusChange(bool in_focus) { if (!text_input_.get()) return; + + pp::VarDictionary message; + message.Set(pp::Var(kType), pp::Var(kJSFieldFocusType)); + message.Set(pp::Var(kJSFieldFocus), pp::Var(in_focus)); + PostMessage(message); + if (in_focus) text_input_->SetTextInputType(PP_TEXTINPUT_TYPE_DEV_TEXT); else |