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