| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <cmath> | 5 #include <cmath> |
| 6 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 #include <stdio.h> | 7 #include <stdio.h> |
| 8 | 8 |
| 9 #include "ppapi/c/dev/ppb_console_dev.h" | 9 #include "ppapi/c/dev/ppb_console_dev.h" |
| 10 #include "ppapi/c/ppb_input_event.h" | 10 #include "ppapi/c/ppb_input_event.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 case PP_INPUTEVENT_TYPE_KEYDOWN: { | 68 case PP_INPUTEVENT_TYPE_KEYDOWN: { |
| 69 pp::KeyboardInputEvent key_event(event); | 69 pp::KeyboardInputEvent key_event(event); |
| 70 // Lock the mouse when the Enter key is pressed. | 70 // Lock the mouse when the Enter key is pressed. |
| 71 if (key_event.GetKeyCode() == 13) { | 71 if (key_event.GetKeyCode() == 13) { |
| 72 if (mouse_locked_) { | 72 if (mouse_locked_) { |
| 73 UnlockMouse(); | 73 UnlockMouse(); |
| 74 } else { | 74 } else { |
| 75 LockMouse(callback_factory_.NewRequiredCallback( | 75 LockMouse(callback_factory_.NewRequiredCallback( |
| 76 &MyInstance::DidLockMouse)); | 76 &MyInstance::DidLockMouse)); |
| 77 } | 77 } |
| 78 return true; |
| 78 } | 79 } |
| 79 return true; | 80 return false; |
| 80 } | 81 } |
| 81 default: | 82 default: |
| 82 return false; | 83 return false; |
| 83 } | 84 } |
| 84 } | 85 } |
| 85 | 86 |
| 86 virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) { | 87 virtual void DidChangeView(const pp::Rect& position, const pp::Rect& clip) { |
| 87 if (position.size().width() == width_ && | 88 if (position.size().width() == width_ && |
| 88 position.size().height() == height_) | 89 position.size().height() == height_) |
| 89 return; // We don't care about the position, only the size. | 90 return; // We don't care about the position, only the size. |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 265 |
| 265 namespace pp { | 266 namespace pp { |
| 266 | 267 |
| 267 // Factory function for your specialization of the Module object. | 268 // Factory function for your specialization of the Module object. |
| 268 Module* CreateModule() { | 269 Module* CreateModule() { |
| 269 return new MyModule(); | 270 return new MyModule(); |
| 270 } | 271 } |
| 271 | 272 |
| 272 } // namespace pp | 273 } // namespace pp |
| 273 | 274 |
| OLD | NEW |