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/native_app_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/extensions/native_app_window_gtk.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h" | 9 #include "chrome/browser/ui/gtk/extensions/extension_keybinding_registry_gtk.h" |
10 #include "chrome/browser/ui/gtk/gtk_util.h" | 10 #include "chrome/browser/ui/gtk/gtk_util.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 } // namespace | 28 } // namespace |
29 | 29 |
30 NativeAppWindowGtk::NativeAppWindowGtk(ShellWindow* shell_window, | 30 NativeAppWindowGtk::NativeAppWindowGtk(ShellWindow* shell_window, |
31 const ShellWindow::CreateParams& params) | 31 const ShellWindow::CreateParams& params) |
32 : shell_window_(shell_window), | 32 : shell_window_(shell_window), |
33 window_(NULL), | 33 window_(NULL), |
34 state_(GDK_WINDOW_STATE_WITHDRAWN), | 34 state_(GDK_WINDOW_STATE_WITHDRAWN), |
35 is_active_(false), | 35 is_active_(false), |
36 content_thinks_its_fullscreen_(false), | 36 content_thinks_its_fullscreen_(false), |
37 frameless_(params.frame == ShellWindow::CreateParams::FRAME_NONE) { | 37 frameless_(params.frame == ShellWindow::FRAME_NONE) { |
38 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); | 38 window_ = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); |
39 | 39 |
40 gfx::NativeView native_view = | 40 gfx::NativeView native_view = |
41 web_contents()->GetView()->GetNativeView(); | 41 web_contents()->GetView()->GetNativeView(); |
42 gtk_container_add(GTK_CONTAINER(window_), native_view); | 42 gtk_container_add(GTK_CONTAINER(window_), native_view); |
43 | 43 |
44 if (params.bounds.x() != INT_MIN && params.bounds.y() != INT_MIN) | 44 if (params.bounds.x() != INT_MIN && params.bounds.y() != INT_MIN) |
45 gtk_window_move(window_, params.bounds.x(), params.bounds.y()); | 45 gtk_window_move(window_, params.bounds.x(), params.bounds.y()); |
46 | 46 |
47 // This is done to avoid a WM "feature" where setting the window size to | 47 // This is done to avoid a WM "feature" where setting the window size to |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 | 362 |
363 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); | 363 draggable_region_.reset(ShellWindow::RawDraggableRegionsToSkRegion(regions)); |
364 } | 364 } |
365 | 365 |
366 // static | 366 // static |
367 NativeAppWindow* NativeAppWindow::Create( | 367 NativeAppWindow* NativeAppWindow::Create( |
368 ShellWindow* shell_window, | 368 ShellWindow* shell_window, |
369 const ShellWindow::CreateParams& params) { | 369 const ShellWindow::CreateParams& params) { |
370 return new NativeAppWindowGtk(shell_window, params); | 370 return new NativeAppWindowGtk(shell_window, params); |
371 } | 371 } |
OLD | NEW |