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" |
11 #include "chrome/browser/automation/ui_controls.h" | 11 #include "chrome/browser/automation/ui_controls.h" |
12 #include "chrome/browser/ui/browser.h" | 12 #include "chrome/browser/ui/browser.h" |
13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
14 #include "chrome/browser/ui/gtk/view_id_util.h" | 14 #include "chrome/browser/ui/gtk/view_id_util.h" |
15 #if defined(TOOLKIT_VIEWS) | 15 #if defined(TOOLKIT_VIEWS) |
16 #include "chrome/browser/ui/views/frame/browser_view.h" | 16 #include "chrome/browser/ui/views/frame/browser_view.h" |
17 #include "views/focus/focus_manager.h" | 17 #include "ui/views/focus/focus_manager.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace ui_test_utils { | 20 namespace ui_test_utils { |
21 | 21 |
22 #if !defined(TOOLKIT_VIEWS) | 22 #if !defined(TOOLKIT_VIEWS) |
23 namespace { | 23 namespace { |
24 | 24 |
25 // Check if the focused widget for |root| is |target| or a child of |target|. | 25 // Check if the focused widget for |root| is |target| or a child of |target|. |
26 static bool IsWidgetInFocusChain(GtkWidget* root, GtkWidget* target) { | 26 static bool IsWidgetInFocusChain(GtkWidget* root, GtkWidget* target) { |
27 GtkWidget* iter = root; | 27 GtkWidget* iter = root; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 gtk_widget_hide(GTK_WIDGET(window)); | 87 gtk_widget_hide(GTK_WIDGET(window)); |
88 } | 88 } |
89 | 89 |
90 bool ShowAndFocusNativeWindow(gfx::NativeWindow window) { | 90 bool 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 gtk_window_present(GTK_WINDOW(window)); | 92 gtk_window_present(GTK_WINDOW(window)); |
93 return true; | 93 return true; |
94 } | 94 } |
95 | 95 |
96 } // namespace ui_test_utils | 96 } // namespace ui_test_utils |
OLD | NEW |