| 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 index); | 198 index); |
| 199 Widget* widget = Widget::GetWidgetForNativeView(page); | 199 Widget* widget = Widget::GetWidgetForNativeView(page); |
| 200 DCHECK(widget); | 200 DCHECK(widget); |
| 201 return widget; | 201 return widget; |
| 202 } | 202 } |
| 203 | 203 |
| 204 View* NativeTabbedPaneGtk::GetTabViewAt(int index) { | 204 View* NativeTabbedPaneGtk::GetTabViewAt(int index) { |
| 205 Widget* widget = GetWidgetAt(index); | 205 Widget* widget = GetWidgetAt(index); |
| 206 DCHECK(widget); | 206 DCHECK(widget); |
| 207 DCHECK_EQ(1, widget->GetRootView()->child_count()); | 207 DCHECK_EQ(1, widget->GetRootView()->child_count()); |
| 208 return widget->GetRootView()->GetChildViewAt(0); | 208 return widget->GetRootView()->child_at(0); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void NativeTabbedPaneGtk::OnSwitchPage(int selected_tab_index) { | 211 void NativeTabbedPaneGtk::OnSwitchPage(int selected_tab_index) { |
| 212 TabbedPaneListener* listener = tabbed_pane_->listener(); | 212 TabbedPaneListener* listener = tabbed_pane_->listener(); |
| 213 if (listener != NULL) | 213 if (listener != NULL) |
| 214 listener->TabSelectedAt(selected_tab_index); | 214 listener->TabSelectedAt(selected_tab_index); |
| 215 } | 215 } |
| 216 | 216 |
| 217 // static | 217 // static |
| 218 void NativeTabbedPaneGtk::CallSwitchPage(GtkNotebook* widget, | 218 void NativeTabbedPaneGtk::CallSwitchPage(GtkNotebook* widget, |
| 219 GtkNotebookPage* page, | 219 GtkNotebookPage* page, |
| 220 guint selected_tab_index, | 220 guint selected_tab_index, |
| 221 NativeTabbedPaneGtk* tabbed_pane) { | 221 NativeTabbedPaneGtk* tabbed_pane) { |
| 222 tabbed_pane->OnSwitchPage(selected_tab_index); | 222 tabbed_pane->OnSwitchPage(selected_tab_index); |
| 223 } | 223 } |
| 224 | 224 |
| 225 //////////////////////////////////////////////////////////////////////////////// | 225 //////////////////////////////////////////////////////////////////////////////// |
| 226 // NativeTabbedPaneWrapper, public: | 226 // NativeTabbedPaneWrapper, public: |
| 227 | 227 |
| 228 // static | 228 // static |
| 229 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( | 229 NativeTabbedPaneWrapper* NativeTabbedPaneWrapper::CreateNativeWrapper( |
| 230 TabbedPane* tabbed_pane) { | 230 TabbedPane* tabbed_pane) { |
| 231 return new NativeTabbedPaneGtk(tabbed_pane); | 231 return new NativeTabbedPaneGtk(tabbed_pane); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace views | 234 } // namespace views |
| OLD | NEW |