OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // profile will be used. Testing may require a specific |open_tabs_delegate|. | 60 // profile will be used. Testing may require a specific |open_tabs_delegate|. |
61 RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider, | 61 RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider, |
62 Browser* browser, | 62 Browser* browser, |
63 sync_driver::OpenTabsUIDelegate* open_tabs_delegate); | 63 sync_driver::OpenTabsUIDelegate* open_tabs_delegate); |
64 ~RecentTabsSubMenuModel() override; | 64 ~RecentTabsSubMenuModel() override; |
65 | 65 |
66 // Overridden from ui::SimpleMenuModel::Delegate: | 66 // Overridden from ui::SimpleMenuModel::Delegate: |
67 bool IsCommandIdChecked(int command_id) const override; | 67 bool IsCommandIdChecked(int command_id) const override; |
68 bool IsCommandIdEnabled(int command_id) const override; | 68 bool IsCommandIdEnabled(int command_id) const override; |
69 bool GetAcceleratorForCommandId(int command_id, | 69 bool GetAcceleratorForCommandId(int command_id, |
70 ui::Accelerator* accelerator) override; | 70 ui::Accelerator* accelerator) const override; |
71 void ExecuteCommand(int command_id, int event_flags) override; | 71 void ExecuteCommand(int command_id, int event_flags) override; |
72 const gfx::FontList* GetLabelFontListAt(int index) const override; | 72 const gfx::FontList* GetLabelFontListAt(int index) const override; |
73 | 73 |
74 int GetMaxWidthForItemAtIndex(int item_index) const; | 74 int GetMaxWidthForItemAtIndex(int item_index) const; |
75 bool GetURLAndTitleForItemAtIndex(int index, | 75 bool GetURLAndTitleForItemAtIndex(int index, |
76 std::string* url, | 76 std::string* url, |
77 base::string16* title); | 77 base::string16* title); |
78 | 78 |
79 private: | 79 private: |
80 struct TabNavigationItem; | 80 struct TabNavigationItem; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 177 |
178 // Time the menu is open for until a recent tab is selected. | 178 // Time the menu is open for until a recent tab is selected. |
179 base::ElapsedTimer menu_opened_timer_; | 179 base::ElapsedTimer menu_opened_timer_; |
180 | 180 |
181 base::WeakPtrFactory<RecentTabsSubMenuModel> weak_ptr_factory_; | 181 base::WeakPtrFactory<RecentTabsSubMenuModel> weak_ptr_factory_; |
182 | 182 |
183 DISALLOW_COPY_AND_ASSIGN(RecentTabsSubMenuModel); | 183 DISALLOW_COPY_AND_ASSIGN(RecentTabsSubMenuModel); |
184 }; | 184 }; |
185 | 185 |
186 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ | 186 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ |
OLD | NEW |