| 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 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |