OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/shell_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/shell_window_gtk.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
9 #include "content/public/browser/render_widget_host_view.h" | 9 #include "content/public/browser/render_widget_host_view.h" |
10 #include "content/public/browser/web_contents.h" | 10 #include "content/public/browser/web_contents.h" |
11 #include "content/public/browser/web_contents_view.h" | 11 #include "content/public/browser/web_contents_view.h" |
12 #include "ui/base/x/active_window_watcher_x.h" | 12 #include "ui/base/x/active_window_watcher_x.h" |
13 #include "ui/gfx/rect.h" | 13 #include "ui/gfx/rect.h" |
14 | 14 |
15 ShellWindowGtk::ShellWindowGtk(Profile* profile, | 15 ShellWindowGtk::ShellWindowGtk(Profile* profile, |
16 const Extension* extension, | 16 const extensions::Extension* extension, |
17 const GURL& url) | 17 const GURL& url) |
18 : ShellWindow(profile, extension, url), | 18 : ShellWindow(profile, extension, url), |
19 state_(GDK_WINDOW_STATE_WITHDRAWN), | 19 state_(GDK_WINDOW_STATE_WITHDRAWN), |
20 is_active_(!ui::ActiveWindowWatcherX::WMSupportsActivation()) { | 20 is_active_(!ui::ActiveWindowWatcherX::WMSupportsActivation()) { |
21 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 21 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
22 | 22 |
23 gfx::NativeView native_view = | 23 gfx::NativeView native_view = |
24 web_contents()->GetView()->GetNativeView(); | 24 web_contents()->GetView()->GetNativeView(); |
25 gtk_container_add(GTK_CONTAINER(window_), native_view); | 25 gtk_container_add(GTK_CONTAINER(window_), native_view); |
26 | 26 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 } | 161 } |
162 | 162 |
163 gboolean ShellWindowGtk::OnWindowState(GtkWidget* sender, | 163 gboolean ShellWindowGtk::OnWindowState(GtkWidget* sender, |
164 GdkEventWindowState* event) { | 164 GdkEventWindowState* event) { |
165 state_ = event->new_window_state; | 165 state_ = event->new_window_state; |
166 return FALSE; | 166 return FALSE; |
167 } | 167 } |
168 | 168 |
169 // static | 169 // static |
170 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 170 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
171 const Extension* extension, | 171 const extensions::Extension* extension, |
172 const GURL& url) { | 172 const GURL& url) { |
173 return new ShellWindowGtk(profile, extension, url); | 173 return new ShellWindowGtk(profile, extension, url); |
174 } | 174 } |
OLD | NEW |