OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/controls/tabbed_pane/native_tabbed_pane_gtk.h" | 5 #include "views/controls/tabbed_pane/native_tabbed_pane_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "app/gfx/canvas.h" | 9 #include "app/gfx/canvas.h" |
10 #include "app/gfx/font.h" | 10 #include "app/gfx/font.h" |
| 11 #include "app/gfx/skia_utils_gtk.h" |
11 #include "app/resource_bundle.h" | 12 #include "app/resource_bundle.h" |
12 #include "base/logging.h" | 13 #include "base/logging.h" |
13 #include "base/stl_util-inl.h" | 14 #include "base/stl_util-inl.h" |
14 #include "base/string_util.h" | 15 #include "base/string_util.h" |
15 #include "skia/ext/skia_utils_gtk.h" | |
16 #include "views/background.h" | 16 #include "views/background.h" |
17 #include "views/controls/tabbed_pane/tabbed_pane.h" | 17 #include "views/controls/tabbed_pane/tabbed_pane.h" |
18 #include "views/fill_layout.h" | 18 #include "views/fill_layout.h" |
19 #include "views/widget/root_view.h" | 19 #include "views/widget/root_view.h" |
20 #include "views/widget/widget_gtk.h" | 20 #include "views/widget/widget_gtk.h" |
21 | 21 |
22 namespace views { | 22 namespace views { |
23 | 23 |
24 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
25 // NativeTabbedPaneGtk, public: | 25 // NativeTabbedPaneGtk, public: |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 page_container->SetContentsView(contents); | 138 page_container->SetContentsView(contents); |
139 page_container->SetFocusTraversableParent(GetRootView()); | 139 page_container->SetFocusTraversableParent(GetRootView()); |
140 page_container->SetFocusTraversableParentView(this); | 140 page_container->SetFocusTraversableParentView(this); |
141 page_container->Show(); | 141 page_container->Show(); |
142 | 142 |
143 if (!contents->background()) { | 143 if (!contents->background()) { |
144 GtkStyle* window_style = | 144 GtkStyle* window_style = |
145 gtk_widget_get_style(page_container->GetNativeView()); | 145 gtk_widget_get_style(page_container->GetNativeView()); |
146 contents->set_background( | 146 contents->set_background( |
147 Background::CreateSolidBackground( | 147 Background::CreateSolidBackground( |
148 skia::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); | 148 gfx::GdkColorToSkColor(window_style->bg[GTK_STATE_NORMAL]))); |
149 } | 149 } |
150 | 150 |
151 GtkWidget* page = page_container->GetNativeView(); | 151 GtkWidget* page = page_container->GetNativeView(); |
152 | 152 |
153 // increment ref count not to delete on remove below | 153 // increment ref count not to delete on remove below |
154 g_object_ref(page); | 154 g_object_ref(page); |
155 // detach parent from the page so that we can add it to notebook | 155 // detach parent from the page so that we can add it to notebook |
156 GtkWidget* parent = gtk_widget_get_parent(page); | 156 GtkWidget* parent = gtk_widget_get_parent(page); |
157 gtk_container_remove(GTK_CONTAINER(parent), page); | 157 gtk_container_remove(GTK_CONTAINER(parent), page); |
158 | 158 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 //////////////////////////////////////////////////////////////////////////////// | 200 //////////////////////////////////////////////////////////////////////////////// |
201 // NativeTabbedPaneWrapper, public: | 201 // NativeTabbedPaneWrapper, public: |
202 | 202 |
203 // static | 203 // static |
204 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | 204 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( |
205 TabbedPane* tabbed_pane) { | 205 TabbedPane* tabbed_pane) { |
206 return new NativeTabbedPaneGtk(tabbed_pane); | 206 return new NativeTabbedPaneGtk(tabbed_pane); |
207 } | 207 } |
208 | 208 |
209 } // namespace views | 209 } // namespace views |
OLD | NEW |