| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_GTK_H_ | |
| 6 #define VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_GTK_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "views/controls/native_control_gtk.h" | |
| 12 #include "views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" | |
| 13 | |
| 14 namespace views { | |
| 15 | |
| 16 class NativeTabbedPaneGtk : public NativeControlGtk, | |
| 17 public NativeTabbedPaneWrapper { | |
| 18 public: | |
| 19 explicit NativeTabbedPaneGtk(TabbedPane* tabbed_pane); | |
| 20 virtual ~NativeTabbedPaneGtk(); | |
| 21 | |
| 22 // NativeControlGtk: | |
| 23 virtual void CreateNativeControl() OVERRIDE; | |
| 24 | |
| 25 // NativeTabbedPaneWrapper: | |
| 26 virtual void AddTab(const string16& title, View* contents) OVERRIDE; | |
| 27 virtual void AddTabAtIndex(int index, | |
| 28 const string16& title, | |
| 29 View* contents, | |
| 30 bool select_if_first_tab) OVERRIDE; | |
| 31 virtual View* RemoveTabAtIndex(int index) OVERRIDE; | |
| 32 virtual void SelectTabAt(int index) OVERRIDE; | |
| 33 virtual int GetTabCount() OVERRIDE; | |
| 34 virtual int GetSelectedTabIndex() OVERRIDE; | |
| 35 virtual View* GetSelectedTab() OVERRIDE; | |
| 36 virtual View* GetView() OVERRIDE; | |
| 37 virtual void SetFocus() OVERRIDE; | |
| 38 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 39 virtual gfx::NativeView GetTestingHandle() const OVERRIDE; | |
| 40 | |
| 41 // View: | |
| 42 virtual FocusTraversable* GetFocusTraversable() OVERRIDE; | |
| 43 | |
| 44 private: | |
| 45 void DoAddTabAtIndex(int index, | |
| 46 const string16& title, | |
| 47 View* contents, | |
| 48 bool select_if_first_tab); | |
| 49 | |
| 50 // Returns the Widget containing the tab contents at |index|. | |
| 51 Widget* GetWidgetAt(int index); | |
| 52 | |
| 53 View* GetTabViewAt(int index); | |
| 54 void OnSwitchPage(int selected_tab_index); | |
| 55 | |
| 56 static void CallSwitchPage(GtkNotebook* widget, | |
| 57 GtkNotebookPage* page, | |
| 58 guint selected_tab_index, | |
| 59 NativeTabbedPaneGtk* tabbed_pane); | |
| 60 | |
| 61 // The tabbed-pane we are bound to. | |
| 62 TabbedPane* tabbed_pane_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(NativeTabbedPaneGtk); | |
| 65 }; | |
| 66 | |
| 67 } // namespace views | |
| 68 | |
| 69 #endif // VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_GTK_H_ | |
| OLD | NEW |