| 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 "ui/ui_controls/ui_controls_aura.h" | 5 #include "ui/ui_controls/ui_controls.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace ui_controls { | 9 namespace ui_controls { |
| 10 namespace { | |
| 11 UIControlsAura* instance_ = NULL; | |
| 12 } // namespace | |
| 13 | 10 |
| 14 // An interface to provide Aura implementation of UI control. | 11 UIControls* CreateNativeUIControls() { |
| 15 bool SendKeyPress(gfx::NativeWindow window, | 12 NOTIMPLEMENTED() << "Implementation should be installed at a higher level."; |
| 16 ui::KeyboardCode key, | 13 return NULL; |
| 17 bool control, | |
| 18 bool shift, | |
| 19 bool alt, | |
| 20 bool command) { | |
| 21 return instance_->SendKeyPress( | |
| 22 window, key, control, shift, alt, command); | |
| 23 } | |
| 24 | |
| 25 // static | |
| 26 bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window, | |
| 27 ui::KeyboardCode key, | |
| 28 bool control, | |
| 29 bool shift, | |
| 30 bool alt, | |
| 31 bool command, | |
| 32 const base::Closure& task) { | |
| 33 return instance_->SendKeyPressNotifyWhenDone( | |
| 34 window, key, control, shift, alt, command, task); | |
| 35 } | |
| 36 | |
| 37 // static | |
| 38 bool SendMouseMove(long x, long y) { | |
| 39 return instance_->SendMouseMove(x, y); | |
| 40 } | |
| 41 | |
| 42 // static | |
| 43 bool SendMouseMoveNotifyWhenDone(long x, | |
| 44 long y, | |
| 45 const base::Closure& task) { | |
| 46 return instance_->SendMouseMoveNotifyWhenDone(x, y, task); | |
| 47 } | |
| 48 | |
| 49 // static | |
| 50 bool SendMouseEvents(MouseButton type, int state) { | |
| 51 return instance_->SendMouseEvents(type, state); | |
| 52 } | |
| 53 | |
| 54 // static | |
| 55 bool SendMouseEventsNotifyWhenDone(MouseButton type, | |
| 56 int state, | |
| 57 const base::Closure& task) { | |
| 58 return instance_->SendMouseEventsNotifyWhenDone(type, state, task); | |
| 59 } | |
| 60 | |
| 61 // static | |
| 62 bool SendMouseClick(MouseButton type) { | |
| 63 return instance_->SendMouseClick(type); | |
| 64 } | |
| 65 | |
| 66 // static | |
| 67 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { | |
| 68 instance_->RunClosureAfterAllPendingUIEvents(closure); | |
| 69 } | |
| 70 | |
| 71 UIControlsAura::UIControlsAura() { | |
| 72 } | |
| 73 | |
| 74 UIControlsAura::~UIControlsAura() { | |
| 75 } | |
| 76 | |
| 77 // static. declared in ui_controls.h | |
| 78 void InstallUIControlsAura(UIControlsAura* instance) { | |
| 79 delete instance_; | |
| 80 instance_ = instance; | |
| 81 } | 14 } |
| 82 | 15 |
| 83 } // namespace ui_controls | 16 } // namespace ui_controls |
| OLD | NEW |