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

Side by Side Diff: chrome/browser/ui/gtk/constrained_window_gtk.cc

Issue 8344061: content: Split off ChromeTabContentsViewGtk from TabContentsViewGtk. This new (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix clang Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/ui/gtk/constrained_window_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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_hig_constants.h" 16 #include "ui/base/gtk/gtk_hig_constants.h"
17 17
18 #if defined(TOUCH_UI) 18 #if defined(TOUCH_UI)
19 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h" 19 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
20 #elif defined(TOOLKIT_VIEWS) 20 #elif defined(TOOLKIT_VIEWS)
21 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h" 21 #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" 22 #include "chrome/browser/ui/views/tab_contents/tab_contents_view_views.h"
23 #else 23 #else
24 #include "chrome/browser/tab_contents/chrome_tab_contents_view_wrapper_gtk.h"
24 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h" 25 #include "chrome/browser/tab_contents/tab_contents_view_gtk.h"
25 #endif 26 #endif
26 27
27 using content::BrowserThread; 28 using content::BrowserThread;
28 29
29 ConstrainedWindowGtkDelegate::~ConstrainedWindowGtkDelegate() { 30 ConstrainedWindowGtkDelegate::~ConstrainedWindowGtkDelegate() {
30 } 31 }
31 32
32 bool ConstrainedWindowGtkDelegate::GetBackgroundColor(GdkColor* color) { 33 bool ConstrainedWindowGtkDelegate::GetBackgroundColor(GdkColor* color) {
33 return false; 34 return false;
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 132 }
132 } 133 }
133 134
134 ConstrainedWindowGtk::TabContentsViewType* 135 ConstrainedWindowGtk::TabContentsViewType*
135 ConstrainedWindowGtk::ContainingView() { 136 ConstrainedWindowGtk::ContainingView() {
136 #if defined(TOOLKIT_VIEWS) && !defined(TOUCH_UI) 137 #if defined(TOOLKIT_VIEWS) && !defined(TOUCH_UI)
137 return static_cast<NativeTabContentsViewGtk*>( 138 return static_cast<NativeTabContentsViewGtk*>(
138 static_cast<TabContentsViewViews*>(wrapper_->view())-> 139 static_cast<TabContentsViewViews*>(wrapper_->view())->
139 native_tab_contents_view()); 140 native_tab_contents_view());
140 #else 141 #else
141 return static_cast<TabContentsViewType*>(wrapper_->view()); 142 return static_cast<TabContentsViewType*>(
143 static_cast<TabContentsViewGtk*>(wrapper_->view())->
144 wrapper());
142 #endif 145 #endif
143 } 146 }
144 147
145 gboolean ConstrainedWindowGtk::OnKeyPress(GtkWidget* sender, 148 gboolean ConstrainedWindowGtk::OnKeyPress(GtkWidget* sender,
146 GdkEventKey* key) { 149 GdkEventKey* key) {
147 if (key->keyval == GDK_Escape) { 150 if (key->keyval == GDK_Escape) {
148 // Let the stack unwind so the event handler can release its ref 151 // Let the stack unwind so the event handler can release its ref
149 // on widget(). 152 // on widget().
150 MessageLoop::current()->PostTask( 153 MessageLoop::current()->PostTask(
151 FROM_HERE, 154 FROM_HERE,
152 base::Bind(&ConstrainedWindowGtk::CloseConstrainedWindow, 155 base::Bind(&ConstrainedWindowGtk::CloseConstrainedWindow,
153 weak_factory_.GetWeakPtr())); 156 weak_factory_.GetWeakPtr()));
154 return TRUE; 157 return TRUE;
155 } 158 }
156 159
157 return FALSE; 160 return FALSE;
158 } 161 }
159 162
160 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender, 163 void ConstrainedWindowGtk::OnHierarchyChanged(GtkWidget* sender,
161 GtkWidget* previous_toplevel) { 164 GtkWidget* previous_toplevel) {
162 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 165 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
163 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(widget()))) 166 if (!GTK_WIDGET_TOPLEVEL(gtk_widget_get_toplevel(widget())))
164 return; 167 return;
165 168
166 FocusConstrainedWindow(); 169 FocusConstrainedWindow();
167 } 170 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/constrained_window_gtk.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698