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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // opened tabs of other devices. | 40 // opened tabs of other devices. |
41 class RecentTabsSubMenuModel : public ui::SimpleMenuModel, | 41 class RecentTabsSubMenuModel : public ui::SimpleMenuModel, |
42 public ui::SimpleMenuModel::Delegate, | 42 public ui::SimpleMenuModel::Delegate, |
43 public TabRestoreServiceObserver { | 43 public TabRestoreServiceObserver { |
44 public: | 44 public: |
45 // Command Id for recently closed items header or disabled item to which the | 45 // Command Id for recently closed items header or disabled item to which the |
46 // accelerator string will be appended. | 46 // accelerator string will be appended. |
47 static const int kRecentlyClosedHeaderCommandId; | 47 static const int kRecentlyClosedHeaderCommandId; |
48 static const int kDisabledRecentlyClosedHeaderCommandId; | 48 static const int kDisabledRecentlyClosedHeaderCommandId; |
49 | 49 |
| 50 // Exposed for tests only: return the Command Id for the first entry in the |
| 51 // recently closed window items list. |
| 52 static int GetFirstRecentTabsCommandId(); |
| 53 |
50 // If |open_tabs_delegate| is NULL, the default delegate for |browser|'s | 54 // If |open_tabs_delegate| is NULL, the default delegate for |browser|'s |
51 // profile will be used. Testing may require a specific |open_tabs_delegate|. | 55 // profile will be used. Testing may require a specific |open_tabs_delegate|. |
52 RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider, | 56 RecentTabsSubMenuModel(ui::AcceleratorProvider* accelerator_provider, |
53 Browser* browser, | 57 Browser* browser, |
54 browser_sync::OpenTabsUIDelegate* open_tabs_delegate); | 58 browser_sync::OpenTabsUIDelegate* open_tabs_delegate); |
55 virtual ~RecentTabsSubMenuModel(); | 59 virtual ~RecentTabsSubMenuModel(); |
56 | 60 |
57 // Overridden from ui::SimpleMenuModel::Delegate: | 61 // Overridden from ui::SimpleMenuModel::Delegate: |
58 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; | 62 virtual bool IsCommandIdChecked(int command_id) const OVERRIDE; |
59 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; | 63 virtual bool IsCommandIdEnabled(int command_id) const OVERRIDE; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 166 |
163 base::CancelableTaskTracker local_tab_cancelable_task_tracker_; | 167 base::CancelableTaskTracker local_tab_cancelable_task_tracker_; |
164 base::CancelableTaskTracker other_devices_tab_cancelable_task_tracker_; | 168 base::CancelableTaskTracker other_devices_tab_cancelable_task_tracker_; |
165 | 169 |
166 base::WeakPtrFactory<RecentTabsSubMenuModel> weak_ptr_factory_; | 170 base::WeakPtrFactory<RecentTabsSubMenuModel> weak_ptr_factory_; |
167 | 171 |
168 DISALLOW_COPY_AND_ASSIGN(RecentTabsSubMenuModel); | 172 DISALLOW_COPY_AND_ASSIGN(RecentTabsSubMenuModel); |
169 }; | 173 }; |
170 | 174 |
171 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ | 175 #endif // CHROME_BROWSER_UI_TOOLBAR_RECENT_TABS_SUB_MENU_MODEL_H_ |
OLD | NEW |