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

Unified Diff: ui/ui_controls/ui_controls_win.cc

Issue 11419013: Add desktop vs. ash context to ui_controls Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac typo Created 8 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 side-by-side diff with in-line comments
Download patch
Index: ui/ui_controls/ui_controls_win.cc
diff --git a/ui/ui_controls/ui_controls_win.cc b/ui/ui_controls/ui_controls_win.cc
index e411a1779bcb2c2eeb53baff8fa8272ad09c60d4..28ec03b8d9615d9f27b03bdf2345b1b9ff27a816 100644
--- a/ui/ui_controls/ui_controls_win.cc
+++ b/ui/ui_controls/ui_controls_win.cc
@@ -12,52 +12,70 @@
namespace ui_controls {
-bool SendKeyPress(gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command) {
- DCHECK(!command); // No command key on Windows
- return internal::SendKeyPressImpl(window, key, control, shift, alt,
- base::Closure());
-}
+namespace {
-bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
- ui::KeyboardCode key,
- bool control,
- bool shift,
- bool alt,
- bool command,
- const base::Closure& task) {
- DCHECK(!command); // No command key on Windows
- return internal::SendKeyPressImpl(window, key, control, shift, alt, task);
-}
+class UIControlsWin : public UIControls {
+ public:
+ UIControlsWin() {}
oshima 2012/11/16 20:41:39 ditto
scottmg 2012/11/16 22:34:06 Done.
-bool SendMouseMove(long x, long y) {
- return internal::SendMouseMoveImpl(x, y, base::Closure());
-}
+ bool SendKeyPress(gfx::NativeWindow window,
+ ui::KeyboardCode key,
+ bool control,
+ bool shift,
+ bool alt,
+ bool command) OVERRIDE {
+ DCHECK(!command); // No command key on Windows
+ return internal::SendKeyPressImpl(window, key, control, shift, alt,
+ base::Closure());
+ }
-bool SendMouseMoveNotifyWhenDone(long x, long y, const base::Closure& task) {
- return internal::SendMouseMoveImpl(x, y, task);
-}
+ bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
+ ui::KeyboardCode key,
+ bool control,
+ bool shift,
+ bool alt,
+ bool command,
+ const base::Closure& task) OVERRIDE {
+ DCHECK(!command); // No command key on Windows
+ return internal::SendKeyPressImpl(window, key, control, shift, alt, task);
+ }
-bool SendMouseEvents(MouseButton type, int state) {
- return internal::SendMouseEventsImpl(type, state, base::Closure());
-}
+ bool SendMouseMove(long x, long y) OVERRIDE {
+ return internal::SendMouseMoveImpl(x, y, base::Closure());
+ }
-bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
- const base::Closure& task) {
- return internal::SendMouseEventsImpl(type, state, task);
-}
+ bool SendMouseMoveNotifyWhenDone(
+ long x, long y, const base::Closure& task) OVERRIDE {
+ return internal::SendMouseMoveImpl(x, y, task);
+ }
-bool SendMouseClick(MouseButton type) {
- return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure());
-}
+ bool SendMouseEvents(MouseButton type, int state) OVERRIDE {
+ return internal::SendMouseEventsImpl(type, state, base::Closure());
+ }
+
+ bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
+ const base::Closure& task) OVERRIDE {
+ return internal::SendMouseEventsImpl(type, state, task);
+ }
+
+ bool SendMouseClick(MouseButton type) OVERRIDE {
+ return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure());
+ }
+
+ void RunClosureAfterAllPendingUIEvents(
+ const base::Closure& closure) OVERRIDE {
+ // On windows, posting UI events is synchronous so just post the closure.
+ MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(UIControlsWin);
+};
+
+} // namespace
-void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
- // On windows, posting UI events is synchronous so just post the closure.
- MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
+UIControls* CreateNativeUIControls() {
+ return new UIControlsWin;
}
} // namespace ui_controls

Powered by Google App Engine
This is Rietveld 408576698