OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_WIN_JUMPLIST_H_ | 5 #ifndef CHROME_BROWSER_WIN_JUMPLIST_H_ |
6 #define CHROME_BROWSER_WIN_JUMPLIST_H_ | 6 #define CHROME_BROWSER_WIN_JUMPLIST_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 // Terminate the jumplist: cancel any pending updates and stop observing | 113 // Terminate the jumplist: cancel any pending updates and stop observing |
114 // the Profile and its services. This must be called before the |profile_| | 114 // the Profile and its services. This must be called before the |profile_| |
115 // is destroyed. | 115 // is destroyed. |
116 void Terminate(); | 116 void Terminate(); |
117 | 117 |
118 // RefcountedKeyedService: | 118 // RefcountedKeyedService: |
119 void ShutdownOnUIThread() override; | 119 void ShutdownOnUIThread() override; |
120 | 120 |
121 // Returns true if the custom JumpList is enabled. | 121 // Returns true if the custom JumpList is enabled. |
122 // The custom jumplist works only on Windows 7 and above. | |
123 static bool Enabled(); | 122 static bool Enabled(); |
124 | 123 |
125 private: | 124 private: |
126 friend JumpListFactory; | 125 friend JumpListFactory; |
127 explicit JumpList(Profile* profile); // Use JumpListFactory instead | 126 explicit JumpList(Profile* profile); // Use JumpListFactory instead |
128 ~JumpList() override; | 127 ~JumpList() override; |
129 | 128 |
130 // The AddTab and AddWindow functions are copied from the | |
131 // RecentlyClosedTabsHandler class for compatibility with the new-tab page. | |
132 | |
133 // Adds a new ShellLinkItem for |tab| to |data| provided that doing so will | 129 // Adds a new ShellLinkItem for |tab| to |data| provided that doing so will |
134 // not exceed |max_items|. | 130 // not exceed |max_items|. |
135 bool AddTab(const sessions::TabRestoreService::Tab& tab, | 131 bool AddTab(const sessions::TabRestoreService::Tab& tab, |
136 size_t max_items, | 132 size_t max_items, |
137 JumpListData* data); | 133 JumpListData* data); |
138 | 134 |
139 // Adds a new ShellLinkItem for each tab in |window| to |data| provided that | 135 // Adds a new ShellLinkItem for each tab in |window| to |data| provided that |
140 // doing so will not exceed |max_items|. | 136 // doing so will not exceed |max_items|. |
141 void AddWindow(const sessions::TabRestoreService::Window& window, | 137 void AddWindow(const sessions::TabRestoreService::Window& window, |
142 size_t max_items, | 138 size_t max_items, |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 // JumpListIconsOld directory. | 205 // JumpListIconsOld directory. |
210 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; | 206 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; |
211 | 207 |
212 // For callbacks may be run after destruction. | 208 // For callbacks may be run after destruction. |
213 base::WeakPtrFactory<JumpList> weak_ptr_factory_; | 209 base::WeakPtrFactory<JumpList> weak_ptr_factory_; |
214 | 210 |
215 DISALLOW_COPY_AND_ASSIGN(JumpList); | 211 DISALLOW_COPY_AND_ASSIGN(JumpList); |
216 }; | 212 }; |
217 | 213 |
218 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ | 214 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ |
OLD | NEW |