| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 147 |
| 148 //////////////////////////////////////////////////////////////////////////////// | 148 //////////////////////////////////////////////////////////////////////////////// |
| 149 // NativeTabbedPaneGtk, private: | 149 // NativeTabbedPaneGtk, private: |
| 150 void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, | 150 void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, |
| 151 const std::wstring& title, | 151 const std::wstring& title, |
| 152 View* contents, | 152 View* contents, |
| 153 bool select_if_first_tab) { | 153 bool select_if_first_tab) { |
| 154 int tab_count = GetTabCount(); | 154 int tab_count = GetTabCount(); |
| 155 DCHECK(index <= tab_count); | 155 DCHECK(index <= tab_count); |
| 156 | 156 |
| 157 Widget* page_container = Widget::CreateWidget( | 157 Widget* page_container = Widget::CreateWidget(); |
| 158 page_container->Init( |
| 158 Widget::CreateParams(Widget::CreateParams::TYPE_CONTROL)); | 159 Widget::CreateParams(Widget::CreateParams::TYPE_CONTROL)); |
| 159 page_container->Init(NULL, gfx::Rect()); | |
| 160 page_container->SetContentsView(contents); | 160 page_container->SetContentsView(contents); |
| 161 page_container->SetFocusTraversableParent(GetWidget()->GetFocusTraversable()); | 161 page_container->SetFocusTraversableParent(GetWidget()->GetFocusTraversable()); |
| 162 page_container->SetFocusTraversableParentView(this); | 162 page_container->SetFocusTraversableParentView(this); |
| 163 page_container->Show(); | 163 page_container->Show(); |
| 164 | 164 |
| 165 if (!contents->background()) { | 165 if (!contents->background()) { |
| 166 GtkStyle* window_style = | 166 GtkStyle* window_style = |
| 167 gtk_widget_get_style(page_container->GetNativeView()); | 167 gtk_widget_get_style(page_container->GetNativeView()); |
| 168 contents->set_background( | 168 contents->set_background( |
| 169 Background::CreateSolidBackground( | 169 Background::CreateSolidBackground( |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 //////////////////////////////////////////////////////////////////////////////// | 228 //////////////////////////////////////////////////////////////////////////////// |
| 229 // NativeTabbedPaneWrapper, public: | 229 // NativeTabbedPaneWrapper, public: |
| 230 | 230 |
| 231 // static | 231 // static |
| 232 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | 232 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( |
| 233 TabbedPane* tabbed_pane) { | 233 TabbedPane* tabbed_pane) { |
| 234 return new NativeTabbedPaneGtk(tabbed_pane); | 234 return new NativeTabbedPaneGtk(tabbed_pane); |
| 235 } | 235 } |
| 236 | 236 |
| 237 } // namespace views | 237 } // namespace views |
| OLD | NEW |