Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(185)

Unified Diff: pdf/out_of_process_instance.cc

Issue 1359613002: PDF: Prevent left/right arrow shortcuts when a PDF text field is focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename variable Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/test/data/pdf/page_change_test.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pdf/out_of_process_instance.cc
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc
index 3478b78b7935717fc2c04f101f96283013905ce6..cfa11ba980be40c03c854e760bb54365d3a76219 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
« no previous file with comments | « chrome/test/data/pdf/page_change_test.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698