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" |
(...skipping 12 matching lines...) Expand all Loading... |
23 content_thinks_its_fullscreen_(false) { | 23 content_thinks_its_fullscreen_(false) { |
24 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 24 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
25 | 25 |
26 gfx::NativeView native_view = | 26 gfx::NativeView native_view = |
27 web_contents()->GetView()->GetNativeView(); | 27 web_contents()->GetView()->GetNativeView(); |
28 gtk_container_add(GTK_CONTAINER(window_), native_view); | 28 gtk_container_add(GTK_CONTAINER(window_), native_view); |
29 | 29 |
30 gtk_window_set_default_size( | 30 gtk_window_set_default_size( |
31 window_, params.bounds.width(), params.bounds.height()); | 31 window_, params.bounds.width(), params.bounds.height()); |
32 | 32 |
| 33 // Hide titlebar when {frame: 'none'} specified on ShellWindow. |
| 34 if (params.frame == ShellWindow::CreateParams::FRAME_NONE) |
| 35 gtk_window_set_decorated(window_, false); |
| 36 |
33 int min_width = params.minimum_size.width(); | 37 int min_width = params.minimum_size.width(); |
34 int min_height = params.minimum_size.height(); | 38 int min_height = params.minimum_size.height(); |
35 int max_width = params.maximum_size.width(); | 39 int max_width = params.maximum_size.width(); |
36 int max_height = params.maximum_size.height(); | 40 int max_height = params.maximum_size.height(); |
37 GdkGeometry hints; | 41 GdkGeometry hints; |
38 int hints_mask = 0; | 42 int hints_mask = 0; |
39 if (min_width || min_height) { | 43 if (min_width || min_height) { |
40 hints.min_height = min_height; | 44 hints.min_height = min_height; |
41 hints.min_width = min_width; | 45 hints.min_width = min_width; |
42 hints_mask |= GDK_HINT_MIN_SIZE; | 46 hints_mask |= GDK_HINT_MIN_SIZE; |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 return content_thinks_its_fullscreen_; | 224 return content_thinks_its_fullscreen_; |
221 } | 225 } |
222 | 226 |
223 // static | 227 // static |
224 ShellWindow* ShellWindow::CreateImpl(Profile* profile, | 228 ShellWindow* ShellWindow::CreateImpl(Profile* profile, |
225 const extensions::Extension* extension, | 229 const extensions::Extension* extension, |
226 const GURL& url, | 230 const GURL& url, |
227 const ShellWindow::CreateParams& params) { | 231 const ShellWindow::CreateParams& params) { |
228 return new ShellWindowGtk(profile, extension, url, params); | 232 return new ShellWindowGtk(profile, extension, url, params); |
229 } | 233 } |
OLD | NEW |