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

Side by Side Diff: chrome/browser/automation/ui_controls_win.cc

Issue 8820010: Revert 113183 - Revert 113177 - process all ui events before posting closure because menu depends... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
OLDNEW
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 "chrome/browser/automation/ui_controls.h" 5 #include "chrome/browser/automation/ui_controls.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/message_loop.h"
8 #include "chrome/browser/automation/ui_controls_internal.h" 9 #include "chrome/browser/automation/ui_controls_internal.h"
9 #include "ui/gfx/point.h" 10 #include "ui/gfx/point.h"
10 #include "ui/views/view.h" 11 #include "ui/views/view.h"
11 12
12 namespace ui_controls { 13 namespace ui_controls {
13 14
14 bool SendKeyPress(gfx::NativeWindow window, 15 bool SendKeyPress(gfx::NativeWindow window,
15 ui::KeyboardCode key, 16 ui::KeyboardCode key,
16 bool control, 17 bool control,
17 bool shift, 18 bool shift,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 int state, 59 int state,
59 const base::Closure& task) { 60 const base::Closure& task) {
60 DCHECK(view); 61 DCHECK(view);
61 DCHECK(view->GetWidget()); 62 DCHECK(view->GetWidget());
62 gfx::Point view_center(view->width() / 2, view->height() / 2); 63 gfx::Point view_center(view->width() / 2, view->height() / 2);
63 views::View::ConvertPointToScreen(view, &view_center); 64 views::View::ConvertPointToScreen(view, &view_center);
64 SendMouseMove(view_center.x(), view_center.y()); 65 SendMouseMove(view_center.x(), view_center.y());
65 SendMouseEventsNotifyWhenDone(button, state, task); 66 SendMouseEventsNotifyWhenDone(button, state, task);
66 } 67 }
67 68
69 void RunClosureAfterAllPendingUIEvents(const base::Closure& closure) {
70 // On windows, posting UI events is synchronous so just post the closure.
71 MessageLoopForUI::current()->PostTask(FROM_HERE, closure);
72 }
73
68 } // ui_controls 74 } // ui_controls
OLDNEW
« no previous file with comments | « chrome/browser/automation/ui_controls_internal.h ('k') | chrome/test/base/view_event_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698