| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_VIEWS_H_ | |
| 6 #define UI_VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_VIEWS_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "ui/views/controls/tabbed_pane/native_tabbed_pane_wrapper.h" | |
| 11 #include "ui/views/view.h" | |
| 12 | |
| 13 namespace views { | |
| 14 | |
| 15 class TabbedPane; | |
| 16 class TabLayout; | |
| 17 class TabStrip; | |
| 18 class Widget; | |
| 19 | |
| 20 class NativeTabbedPaneViews : public View, | |
| 21 public NativeTabbedPaneWrapper { | |
| 22 public: | |
| 23 explicit NativeTabbedPaneViews(TabbedPane* tabbed_pane); | |
| 24 virtual ~NativeTabbedPaneViews(); | |
| 25 | |
| 26 void TabSelectionChanged(View* selected); | |
| 27 | |
| 28 // Overridden from NativeTabbedPaneWrapper: | |
| 29 virtual void AddTab(const string16& title, View* contents) OVERRIDE; | |
| 30 virtual void AddTabAtIndex(int index, | |
| 31 const string16& title, | |
| 32 View* contents, | |
| 33 bool select_if_first_tab) OVERRIDE; | |
| 34 virtual View* RemoveTabAtIndex(int index) OVERRIDE; | |
| 35 virtual void SelectTabAt(int index) OVERRIDE; | |
| 36 virtual int GetTabCount() OVERRIDE; | |
| 37 virtual int GetSelectedTabIndex() OVERRIDE; | |
| 38 virtual View* GetSelectedTab() OVERRIDE; | |
| 39 virtual View* GetView() OVERRIDE; | |
| 40 virtual void SetFocus() OVERRIDE; | |
| 41 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
| 42 virtual gfx::NativeView GetTestingHandle() const OVERRIDE; | |
| 43 | |
| 44 // View overrides: | |
| 45 virtual void Layout() OVERRIDE; | |
| 46 | |
| 47 private: | |
| 48 void InitControl(); | |
| 49 | |
| 50 // Called upon creation of native control to initialize tabs that are added | |
| 51 // before the native control is created. | |
| 52 void InitializeTabs(); | |
| 53 | |
| 54 // Adds a tab with the given content to native control at the given index. | |
| 55 void AddNativeTab(int index, const string16& title); | |
| 56 | |
| 57 // The tabbed-pane we are bound to. | |
| 58 TabbedPane* tabbed_pane_; | |
| 59 | |
| 60 // The layout manager we use for managing our tabs. | |
| 61 TabLayout* tab_layout_manager_; | |
| 62 | |
| 63 // TabStrip. | |
| 64 TabStrip* tab_strip_; | |
| 65 | |
| 66 // The content displayed in the tab. | |
| 67 View* content_view_; | |
| 68 | |
| 69 DISALLOW_COPY_AND_ASSIGN(NativeTabbedPaneViews); | |
| 70 }; | |
| 71 | |
| 72 } // namespace views | |
| 73 | |
| 74 #endif // UI_VIEWS_CONTROLS_TABBED_PANE_NATIVE_TABBED_PANE_VIEWS_H_ | |
| OLD | NEW |