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

Unified Diff: pdf/out_of_process_instance.cc

Issue 615853003: Handle the keyboard event for ctrl+a inside pdf.js instead of out_of_process_pdf.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 6 years, 2 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/browser/resources/pdf/pdf.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 a385bb3aa93e8fcb8e1ff851786043c6d4bea994..993d804381d99610e374ff9f4680d189f1e6be7c 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -127,6 +127,7 @@ const char kJSEmailBody[] = "body";
// Rotation (Page -> Plugin)
const char kJSRotateClockwiseType[] = "rotateClockwise";
const char kJSRotateCounterclockwiseType[] = "rotateCounterclockwise";
+const char kJSSelectAllType[] = "selectAll";
Nikhil 2014/10/02 12:27:01 How about adding a comment here? Looks to be a pra
Deepak 2014/10/02 12:40:32 Done.
const int kFindResultCooldownMs = 100;
@@ -381,6 +382,8 @@ void OutOfProcessInstance::HandleMessage(const pp::Var& message) {
RotateClockwise();
} else if (type == kJSRotateCounterclockwiseType) {
RotateCounterclockwise();
+ } else if (type == kJSSelectAllType) {
+ engine_->SelectAll();
} else if (type == kJSResetPrintPreviewModeType &&
dict.Get(pp::Var(kJSPrintPreviewUrl)).is_string() &&
dict.Get(pp::Var(kJSPrintPreviewGrayscale)).is_bool() &&
@@ -488,16 +491,6 @@ bool OutOfProcessInstance::HandleInputEvent(
// TODO(raymes): Implement this scroll behavior in JS:
Nikhil 2014/10/02 12:27:00 Is this TODO still valid?
Deepak 2014/10/02 12:40:32 I think this is handles in the js by arrow keys an
// When click+dragging, scroll the document correctly.
- if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN &&
- event.GetModifiers() & kDefaultKeyModifier) {
- pp::KeyboardInputEvent keyboard_event(event);
- switch (keyboard_event.GetKeyCode()) {
- case 'A':
- engine_->SelectAll();
- return true;
- }
- }
-
// Return true for unhandled clicks so the plugin takes focus.
return (event.GetType() == PP_INPUTEVENT_TYPE_MOUSEDOWN);
}
« no previous file with comments | « chrome/browser/resources/pdf/pdf.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698