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

Side by Side Diff: chrome/test/base/ui_test_utils_linux.cc

Issue 8212006: base::Bind: Cleanup in automation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fixes 1. Created 9 years, 2 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
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/test/base/ui_test_utils.h" 5 #include "chrome/test/base/ui_test_utils.h"
6 6
7 #if !defined(USE_AURA) 7 #if !defined(USE_AURA)
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 #endif 9 #endif
10 10
11 #include "base/logging.h" 11 #include "base/logging.h"
csilv 2011/10/10 18:36:47 include base/callback.h
12 #include "base/message_loop.h" 12 #include "base/message_loop.h"
13 #include "chrome/browser/automation/ui_controls.h" 13 #include "chrome/browser/automation/ui_controls.h"
14 #include "chrome/browser/ui/browser.h" 14 #include "chrome/browser/ui/browser.h"
15 #include "chrome/browser/ui/browser_window.h" 15 #include "chrome/browser/ui/browser_window.h"
16 #include "chrome/browser/ui/gtk/view_id_util.h" 16 #include "chrome/browser/ui/gtk/view_id_util.h"
17 #if defined(TOOLKIT_VIEWS) 17 #if defined(TOOLKIT_VIEWS)
18 #include "chrome/browser/ui/views/frame/browser_view.h" 18 #include "chrome/browser/ui/views/frame/browser_view.h"
19 #include "views/focus/focus_manager.h" 19 #include "views/focus/focus_manager.h"
20 #endif 20 #endif
21 21
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 gfx::NativeWindow window = browser_window->GetNativeHandle(); 74 gfx::NativeWindow window = browser_window->GetNativeHandle();
75 DCHECK(window); 75 DCHECK(window);
76 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid); 76 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid);
77 #endif 77 #endif
78 78
79 DCHECK(view); 79 DCHECK(view);
80 ui_controls::MoveMouseToCenterAndPress( 80 ui_controls::MoveMouseToCenterAndPress(
81 view, 81 view,
82 ui_controls::LEFT, 82 ui_controls::LEFT,
83 ui_controls::DOWN | ui_controls::UP, 83 ui_controls::DOWN | ui_controls::UP,
84 new MessageLoop::QuitTask()); 84 base::Closure());
85 RunMessageLoop(); 85 RunMessageLoop();
86 } 86 }
87 87
88 void HideNativeWindow(gfx::NativeWindow window) { 88 void HideNativeWindow(gfx::NativeWindow window) {
89 #if !defined(USE_AURA) 89 #if !defined(USE_AURA)
90 gtk_widget_hide(GTK_WIDGET(window)); 90 gtk_widget_hide(GTK_WIDGET(window));
91 #else 91 #else
92 NOTIMPLEMENTED(); 92 NOTIMPLEMENTED();
93 #endif 93 #endif
94 } 94 }
95 95
96 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { 96 void ShowAndFocusNativeWindow(gfx::NativeWindow window) {
97 #if !defined(USE_AURA) 97 #if !defined(USE_AURA)
98 if (gtk_window_has_toplevel_focus(GTK_WINDOW(window))) 98 if (gtk_window_has_toplevel_focus(GTK_WINDOW(window)))
99 return; 99 return;
100 100
101 gtk_window_present(GTK_WINDOW(window)); 101 gtk_window_present(GTK_WINDOW(window));
102 #else 102 #else
103 NOTIMPLEMENTED(); 103 NOTIMPLEMENTED();
104 #endif 104 #endif
105 } 105 }
106 106
107 } // namespace ui_test_utils 107 } // namespace ui_test_utils
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698