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_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
10 #include "content/public/browser/render_widget_host_view.h" | 10 #include "content/public/browser/render_widget_host_view.h" |
11 #include "content/public/browser/web_contents.h" | 11 #include "content/public/browser/web_contents.h" |
12 #include "content/public/browser/web_contents_view.h" | 12 #include "content/public/browser/web_contents_view.h" |
13 #include "ui/base/x/active_window_watcher_x.h" | 13 #include "ui/base/x/active_window_watcher_x.h" |
14 #include "ui/gfx/rect.h" | 14 #include "ui/gfx/rect.h" |
15 | 15 |
16 ShellWindowGtk::ShellWindowGtk(Profile* profile, | 16 ShellWindowGtk::ShellWindowGtk(Profile* profile, |
17 const extensions::Extension* extension, | 17 const extensions::Extension* extension, |
18 const GURL& url, | 18 const GURL& url, |
19 const ShellWindow::CreateParams& params) | 19 const ShellWindow::CreateParams& params) |
20 : ShellWindow(profile, extension, url), | 20 : ShellWindow(profile, extension, url), |
21 state_(GDK_WINDOW_STATE_WITHDRAWN), | 21 state_(GDK_WINDOW_STATE_WITHDRAWN), |
22 is_active_(!ui::ActiveWindowWatcherX::WMSupportsActivation()) { | 22 is_active_(!ui::ActiveWindowWatcherX::WMSupportsActivation()), |
| 23 content_thinks_its_fullscreen_(false) { |
23 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 24 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
24 | 25 |
25 gfx::NativeView native_view = | 26 gfx::NativeView native_view = |
26 web_contents()->GetView()->GetNativeView(); | 27 web_contents()->GetView()->GetNativeView(); |
27 gtk_container_add(GTK_CONTAINER(window_), native_view); | 28 gtk_container_add(GTK_CONTAINER(window_), native_view); |
28 | 29 |
29 gtk_window_set_default_size( | 30 gtk_window_set_default_size( |
30 window_, params.bounds.width(), params.bounds.height()); | 31 window_, params.bounds.width(), params.bounds.height()); |
31 | 32 |
32 int min_width = params.minimum_size.width(); | 33 int min_width = params.minimum_size.width(); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 return content_thinks_its_fullscreen_; | 220 return content_thinks_its_fullscreen_; |
220 } | 221 } |
221 | 222 |
222 // static | 223 // static |
223 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 224 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
224 const extensions::Extension* extension, | 225 const extensions::Extension* extension, |
225 const GURL& url, | 226 const GURL& url, |
226 const ShellWindow::CreateParams& params) { | 227 const ShellWindow::CreateParams& params) { |
227 return new ShellWindowGtk(profile, extension, url, params); | 228 return new ShellWindowGtk(profile, extension, url, params); |
228 } | 229 } |
OLD | NEW |