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

Side by Side Diff: pdf/instance.cc

Issue 689393002: Fix rotation shortcut keys in PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "pdf/instance.h" 5 #include "pdf/instance.h"
6 6
7 #include <algorithm> // for min() 7 #include <algorithm> // for min()
8 #define _USE_MATH_DEFINES // for M_PI 8 #define _USE_MATH_DEFINES // for M_PI
9 #include <cmath> // for log() and pow() 9 #include <cmath> // for log() and pow()
10 #include <math.h> 10 #include <math.h>
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 590
591 if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN) { 591 if (event.GetType() == PP_INPUTEVENT_TYPE_KEYDOWN) {
592 pp::KeyboardInputEvent keyboard_event(event); 592 pp::KeyboardInputEvent keyboard_event(event);
593 const uint32 modifier = event.GetModifiers(); 593 const uint32 modifier = event.GetModifiers();
594 if (modifier & kDefaultKeyModifier) { 594 if (modifier & kDefaultKeyModifier) {
595 switch (keyboard_event.GetKeyCode()) { 595 switch (keyboard_event.GetKeyCode()) {
596 case 'A': 596 case 'A':
597 engine_->SelectAll(); 597 engine_->SelectAll();
598 return true; 598 return true;
599 } 599 }
600 } else if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) { 600 }
601 if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) {
601 switch (keyboard_event.GetKeyCode()) { 602 switch (keyboard_event.GetKeyCode()) {
602 case ui::VKEY_OEM_4: 603 case ui::VKEY_OEM_4:
603 // Left bracket. 604 // Left bracket.
604 engine_->RotateCounterclockwise(); 605 engine_->RotateCounterclockwise();
605 return true; 606 return true;
606 case ui::VKEY_OEM_6: 607 case ui::VKEY_OEM_6:
607 // Right bracket. 608 // Right bracket.
608 engine_->RotateClockwise(); 609 engine_->RotateClockwise();
609 return true; 610 return true;
610 } 611 }
(...skipping 2158 matching lines...) Expand 10 before | Expand all | Expand 10 after
2769 return instance_->HasScriptableMethod(name, exception); 2770 return instance_->HasScriptableMethod(name, exception);
2770 } 2771 }
2771 2772
2772 pp::Var PDFScriptableObject::Call(const pp::Var& method, 2773 pp::Var PDFScriptableObject::Call(const pp::Var& method,
2773 const std::vector<pp::Var>& args, 2774 const std::vector<pp::Var>& args,
2774 pp::Var* exception) { 2775 pp::Var* exception) {
2775 return instance_->CallScriptableMethod(method, args, exception); 2776 return instance_->CallScriptableMethod(method, args, exception);
2776 } 2777 }
2777 2778
2778 } // namespace chrome_pdf 2779 } // namespace chrome_pdf
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698