| 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/browser/ui/gtk/constrained_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "chrome/browser/ui/browser_list.h" | 10 #include "chrome/browser/ui/browser_list.h" |
| 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" | 11 #include "chrome/browser/ui/constrained_window_tab_helper.h" |
| 12 #include "chrome/browser/ui/gtk/gtk_util.h" | 12 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 13 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 14 #include "content/browser/tab_contents/tab_contents.h" | 14 #include "content/browser/tab_contents/tab_contents.h" |
| 15 #include "content/public/browser/browser_thread.h" | 15 #include "content/public/browser/browser_thread.h" |
| 16 #include "ui/base/gtk/gtk_compat.h" |
| 16 #include "ui/base/gtk/gtk_hig_constants.h" | 17 #include "ui/base/gtk/gtk_hig_constants.h" |
| 17 | 18 |
| 18 #if defined(TOUCH_UI) | 19 #if defined(TOUCH_UI) |
| 19 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 20 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 20 #elif defined(TOOLKIT_VIEWS) | 21 #elif defined(TOOLKIT_VIEWS) |
| 21 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h" | 22 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h" |
| 22 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" | 23 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" |
| 23 #else | 24 #else |
| 24 #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h" | 25 #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h" |
| 25 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" | 26 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 weak_factory_.GetWeakPtr())); | 157 weak_factory_.GetWeakPtr())); |
| 157 return TRUE; | 158 return TRUE; |
| 158 } | 159 } |
| 159 | 160 |
| 160 return FALSE; | 161 return FALSE; |
| 161 } | 162 } |
| 162 | 163 |
| 163 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender, | 164 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender, |
| 164 GtkWidget* previous_toplevel) { | 165 GtkWidget* previous_toplevel) { |
| 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 166 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 166 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(widget()))) | 167 if (!gtk_widget_is_toplevel(gtk_widget_get_toplevel(widget()))) |
| 167 return; | 168 return; |
| 168 | 169 |
| 169 FocusConstrainedWindow(); | 170 FocusConstrainedWindow(); |
| 170 } | 171 } |
| OLD | NEW |