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

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..d627dc2d7974f90a164714e0ddd0ad568cae8aa9 100644
--- a/pdf/out_of_process_instance.cc
+++ b/pdf/out_of_process_instance.cc
@@ -127,6 +127,8 @@ const char kJSEmailBody[] = "body";
// Rotation (Page -> Plugin)
const char kJSRotateClockwiseType[] = "rotateClockwise";
const char kJSRotateCounterclockwiseType[] = "rotateCounterclockwise";
+// Select all text in the document (Page -> Plugin)
+const char kJSSelectAllType[] = "selectAll";
const int kFindResultCooldownMs = 100;
@@ -381,6 +383,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 +492,6 @@ bool OutOfProcessInstance::HandleInputEvent(
// TODO(raymes): Implement this scroll behavior in JS:
// 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