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/panels/panel_gtk.h" | 5 #include "chrome/browser/ui/gtk/panels/panel_gtk.h" |
6 | 6 |
7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/ui/gtk/panels/panel_titlebar_gtk.h" | 22 #include "chrome/browser/ui/gtk/panels/panel_titlebar_gtk.h" |
23 #include "chrome/browser/ui/gtk/panels/panel_drag_gtk.h" | 23 #include "chrome/browser/ui/gtk/panels/panel_drag_gtk.h" |
24 #include "chrome/browser/ui/panels/panel.h" | 24 #include "chrome/browser/ui/panels/panel.h" |
25 #include "chrome/browser/ui/panels/panel_constants.h" | 25 #include "chrome/browser/ui/panels/panel_constants.h" |
26 #include "chrome/browser/ui/panels/panel_manager.h" | 26 #include "chrome/browser/ui/panels/panel_manager.h" |
27 #include "chrome/browser/web_applications/web_app.h" | 27 #include "chrome/browser/web_applications/web_app.h" |
28 #include "chrome/common/chrome_notification_types.h" | 28 #include "chrome/common/chrome_notification_types.h" |
29 #include "content/public/browser/native_web_keyboard_event.h" | 29 #include "content/public/browser/native_web_keyboard_event.h" |
30 #include "content/public/browser/notification_service.h" | 30 #include "content/public/browser/notification_service.h" |
31 #include "content/public/browser/web_contents.h" | 31 #include "content/public/browser/web_contents.h" |
| 32 #include "content/public/browser/web_contents_view.h" |
32 #include "grit/theme_resources.h" | 33 #include "grit/theme_resources.h" |
33 #include "grit/ui_resources.h" | 34 #include "grit/ui_resources.h" |
34 #include "ui/base/accelerators/platform_accelerator_gtk.h" | 35 #include "ui/base/accelerators/platform_accelerator_gtk.h" |
35 #include "ui/base/gtk/gtk_compat.h" | 36 #include "ui/base/gtk/gtk_compat.h" |
36 #include "ui/base/gtk/gtk_expanded_container.h" | 37 #include "ui/base/gtk/gtk_expanded_container.h" |
37 #include "ui/base/gtk/gtk_hig_constants.h" | 38 #include "ui/base/gtk/gtk_hig_constants.h" |
38 #include "ui/base/x/active_window_watcher_x.h" | 39 #include "ui/base/x/active_window_watcher_x.h" |
39 #include "ui/gfx/canvas.h" | 40 #include "ui/gfx/canvas.h" |
40 #include "ui/gfx/image/cairo_cached_surface.h" | 41 #include "ui/gfx/image/cairo_cached_surface.h" |
41 #include "ui/gfx/image/image.h" | 42 #include "ui/gfx/image/image.h" |
(...skipping 892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 // any app running in full screen mode. | 935 // any app running in full screen mode. |
935 } | 936 } |
936 | 937 |
937 void PanelGtk::PanelExpansionStateChanging( | 938 void PanelGtk::PanelExpansionStateChanging( |
938 Panel::ExpansionState old_state, Panel::ExpansionState new_state) { | 939 Panel::ExpansionState old_state, Panel::ExpansionState new_state) { |
939 } | 940 } |
940 | 941 |
941 void PanelGtk::AttachWebContents(content::WebContents* contents) { | 942 void PanelGtk::AttachWebContents(content::WebContents* contents) { |
942 if (!contents) | 943 if (!contents) |
943 return; | 944 return; |
944 gfx::NativeView widget = contents->GetNativeView(); | 945 gfx::NativeView widget = contents->GetView()->GetNativeView(); |
945 if (widget) { | 946 if (widget) { |
946 gtk_container_add(GTK_CONTAINER(contents_expanded_), widget); | 947 gtk_container_add(GTK_CONTAINER(contents_expanded_), widget); |
947 gtk_widget_show(widget); | 948 gtk_widget_show(widget); |
948 contents->WasShown(); | 949 contents->WasShown(); |
949 } | 950 } |
950 } | 951 } |
951 | 952 |
952 void PanelGtk::DetachWebContents(content::WebContents* contents) { | 953 void PanelGtk::DetachWebContents(content::WebContents* contents) { |
953 gfx::NativeView widget = contents->GetNativeView(); | 954 gfx::NativeView widget = contents->GetView()->GetNativeView(); |
954 if (widget) { | 955 if (widget) { |
955 GtkWidget* parent = gtk_widget_get_parent(widget); | 956 GtkWidget* parent = gtk_widget_get_parent(widget); |
956 if (parent) { | 957 if (parent) { |
957 DCHECK_EQ(parent, contents_expanded_); | 958 DCHECK_EQ(parent, contents_expanded_); |
958 gtk_container_remove(GTK_CONTAINER(contents_expanded_), widget); | 959 gtk_container_remove(GTK_CONTAINER(contents_expanded_), widget); |
959 } | 960 } |
960 } | 961 } |
961 } | 962 } |
962 | 963 |
963 gfx::Size PanelGtk::WindowSizeFromContentSize( | 964 gfx::Size PanelGtk::WindowSizeFromContentSize( |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1166 default: | 1167 default: |
1167 NOTREACHED(); | 1168 NOTREACHED(); |
1168 return false; | 1169 return false; |
1169 } | 1170 } |
1170 return gtk_widget_get_visible(button->widget()); | 1171 return gtk_widget_get_visible(button->widget()); |
1171 } | 1172 } |
1172 | 1173 |
1173 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { | 1174 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { |
1174 return panel_gtk_->corner_style_; | 1175 return panel_gtk_->corner_style_; |
1175 } | 1176 } |
OLD | NEW |