OLD | NEW |
---|---|
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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 } | 589 } |
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 } | |
600 } else if (modifier & PP_INPUTEVENT_MODIFIER_CONTROLKEY) { | |
601 switch (keyboard_event.GetKeyCode()) { | |
raymes
2014/11/03 05:23:56
This doesn't look right to me. kDefaultKeyModifier
| |
602 case ui::VKEY_OEM_4: | 599 case ui::VKEY_OEM_4: |
603 // Left bracket. | 600 // Left bracket. |
604 engine_->RotateCounterclockwise(); | 601 engine_->RotateCounterclockwise(); |
605 return true; | 602 return true; |
606 case ui::VKEY_OEM_6: | 603 case ui::VKEY_OEM_6: |
607 // Right bracket. | 604 // Right bracket. |
608 engine_->RotateClockwise(); | 605 engine_->RotateClockwise(); |
609 return true; | 606 return true; |
610 } | 607 } |
611 } | 608 } |
(...skipping 2157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2769 return instance_->HasScriptableMethod(name, exception); | 2766 return instance_->HasScriptableMethod(name, exception); |
2770 } | 2767 } |
2771 | 2768 |
2772 pp::Var PDFScriptableObject::Call(const pp::Var& method, | 2769 pp::Var PDFScriptableObject::Call(const pp::Var& method, |
2773 const std::vector<pp::Var>& args, | 2770 const std::vector<pp::Var>& args, |
2774 pp::Var* exception) { | 2771 pp::Var* exception) { |
2775 return instance_->CallScriptableMethod(method, args, exception); | 2772 return instance_->CallScriptableMethod(method, args, exception); |
2776 } | 2773 } |
2777 | 2774 |
2778 } // namespace chrome_pdf | 2775 } // namespace chrome_pdf |
OLD | NEW |