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

Side by Side Diff: ui/ui_controls/ui_controls_win.cc

Issue 9390038: Move automation/ui_controls to ui/ui_controls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win_aura fix, sync Created 8 years, 9 months 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/ui_controls/ui_controls_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/automation/ui_controls.h" 5 #include "ui/ui_controls/ui_controls.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "chrome/browser/automation/ui_controls_internal.h"
10 #include "ui/gfx/point.h" 9 #include "ui/gfx/point.h"
10 #include "ui/ui_controls/ui_controls_internal_win.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace ui_controls { 13 namespace ui_controls {
14 14
15 bool SendKeyPress(gfx::NativeWindow window, 15 bool SendKeyPress(gfx::NativeWindow window,
16 ui::KeyboardCode key, 16 ui::KeyboardCode key,
17 bool control, 17 bool control,
18 bool shift, 18 bool shift,
19 bool alt, 19 bool alt,
20 bool command) { 20 bool command) {
(...skipping 27 matching lines...) Expand all
48 48
49 bool SendMouseEventsNotifyWhenDone(MouseButton type, int state, 49 bool SendMouseEventsNotifyWhenDone(MouseButton type, int state,
50 const base::Closure& task) { 50 const base::Closure& task) {
51 return internal::SendMouseEventsImpl(type, state, task); 51 return internal::SendMouseEventsImpl(type, state, task);
52 } 52 }
53 53
54 bool SendMouseClick(MouseButton type) { 54 bool SendMouseClick(MouseButton type) {
55 return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure()); 55 return internal::SendMouseEventsImpl(type, UP | DOWN, base::Closure());
56 } 56 }
57 57
58 void MoveMouseToCenterAndPress(views::View* view,
59 MouseButton button,
60 int state,
61 const base::Closure& task) {
62 DCHECK(view);
63 DCHECK(view->GetWidget());
64 gfx::Point view_center(view->width() / 2, view->height() / 2);
65 views::View::ConvertPointToScreen(view, &view_center);
66 SendMouseMove(view_center.x(), view_center.y());
67 SendMouseEventsNotifyWhenDone(button, state, task);
68 }
69
70 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) { 58 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
71 // On windows, posting UI events is synchronous so just post the closure. 59 // On windows, posting UI events is synchronous so just post the closure.
72 MessageLoopForUI::current()->PostTask(FROM_HERE, closure); 60 MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
73 } 61 }
74 62
75 } // ui_controls 63 } // namespace ui_controls
OLDNEW
« no previous file with comments | « ui/ui_controls/ui_controls_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698