| OLD | NEW |
| 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 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 gfx::NativeWindow window = browser_window->GetNativeHandle(); | 72 gfx::NativeWindow window = browser_window->GetNativeHandle(); |
| 73 DCHECK(window); | 73 DCHECK(window); |
| 74 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid); | 74 GtkWidget* view = ViewIDUtil::GetWidget(GTK_WIDGET(window), vid); |
| 75 #endif | 75 #endif |
| 76 | 76 |
| 77 DCHECK(view); | 77 DCHECK(view); |
| 78 ui_controls::MoveMouseToCenterAndPress( | 78 ui_controls::MoveMouseToCenterAndPress( |
| 79 view, | 79 view, |
| 80 ui_controls::LEFT, | 80 ui_controls::LEFT, |
| 81 ui_controls::DOWN | ui_controls::UP, | 81 ui_controls::DOWN | ui_controls::UP, |
| 82 new MessageLoop::QuitTask()); | 82 MessageLoop::QuitClosure()); |
| 83 RunMessageLoop(); | 83 RunMessageLoop(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void HideNativeWindow(gfx::NativeWindow window) { | 86 void HideNativeWindow(gfx::NativeWindow window) { |
| 87 gtk_widget_hide(GTK_WIDGET(window)); | 87 gtk_widget_hide(GTK_WIDGET(window)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { | 90 void ShowAndFocusNativeWindow(gfx::NativeWindow window) { |
| 91 if (gtk_window_has_toplevel_focus(GTK_WINDOW(window))) | 91 if (gtk_window_has_toplevel_focus(GTK_WINDOW(window))) |
| 92 return; | 92 return; |
| 93 | 93 |
| 94 gtk_window_present(GTK_WINDOW(window)); | 94 gtk_window_present(GTK_WINDOW(window)); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace ui_test_utils | 97 } // namespace ui_test_utils |
| OLD | NEW |