Chromium Code Reviews| 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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 170 ChangeReason change_reason) override; | 170 ChangeReason change_reason) override; |
| 171 | 171 |
| 172 // Called on a timer to update the most visited URLs after requests storms | 172 // Called on a timer to update the most visited URLs after requests storms |
| 173 // have subsided. | 173 // have subsided. |
| 174 void DeferredTopSitesChanged(); | 174 void DeferredTopSitesChanged(); |
| 175 | 175 |
| 176 // Called on a timer to update the "Recently Closed" category of JumpList | 176 // Called on a timer to update the "Recently Closed" category of JumpList |
| 177 // after requests storms have subsided. | 177 // after requests storms have subsided. |
| 178 void DeferredTabRestoreServiceChanged(); | 178 void DeferredTabRestoreServiceChanged(); |
| 179 | 179 |
| 180 // Creates at most |max_items| icon files in |icon_dir| for the | |
| 181 // asynchrounously loaded icons stored in |item_list|. | |
| 182 void CreateIconFiles(const base::FilePath& icon_dir, | |
| 183 const ShellLinkItemList& item_list, | |
| 184 size_t max_items); | |
| 185 | |
| 186 // Updates icon files in |icon_dir|, which includes deleting old icons and | |
| 187 // creating at most |slot_limit| new icons for |page_list|. | |
| 188 void UpdateIconFiles(const base::FilePath& icon_dir, | |
| 189 const ShellLinkItemList& page_list, | |
| 190 size_t slot_limit); | |
| 191 | |
| 192 // Updates the jumplist, once all the data has been fetched. This method calls | |
| 193 // UpdateJumpList() to do most of the work. | |
| 194 void RunUpdateJumpList( | |
| 195 IncognitoModePrefs::Availability incognito_availability, | |
| 196 const std::wstring& app_id, | |
|
gab
2017/05/09 14:54:28
Use base::string16 instead of std::wstring (I'm su
chengx
2017/05/09 18:04:14
Done. It did hit the presubmit against wstring, bu
| |
| 197 const base::FilePath& profile_dir, | |
| 198 base::RefCountedData<JumpListData>* ref_counted_data); | |
| 199 | |
| 200 // Updates the application JumpList, which consists of 1) delete old icon | |
| 201 // files; 2) create new icon files; 3) notify the OS. This method is called | |
| 202 // from RunUpdateJumpList(). | |
| 203 // Note that any timeout error along the way results in the old jumplist being | |
| 204 // left as-is, while any non-timeout error results in the old jumplist being | |
| 205 // left as-is, but without icon files. | |
| 206 bool UpdateJumpList(const wchar_t* app_id, | |
| 207 const base::FilePath& profile_dir, | |
| 208 const ShellLinkItemList& most_visited_pages, | |
| 209 const ShellLinkItemList& recently_closed_pages, | |
| 210 bool most_visited_pages_have_updates, | |
| 211 bool recently_closed_pages_have_updates, | |
| 212 IncognitoModePrefs::Availability incognito_availability); | |
| 213 | |
| 180 // Tracks FaviconService tasks. | 214 // Tracks FaviconService tasks. |
| 181 base::CancelableTaskTracker cancelable_task_tracker_; | 215 base::CancelableTaskTracker cancelable_task_tracker_; |
| 182 | 216 |
| 183 // The Profile object is used to listen for events | 217 // The Profile object is used to listen for events |
| 184 Profile* profile_; | 218 Profile* profile_; |
| 185 | 219 |
| 186 // Lives on the UI thread. | 220 // Lives on the UI thread. |
| 187 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; | 221 std::unique_ptr<PrefChangeRegistrar> pref_change_registrar_; |
| 188 | 222 |
| 189 // App id to associate with the jump list. | 223 // App id to associate with the jump list. |
| 190 std::wstring app_id_; | 224 std::wstring app_id_; |
|
gab
2017/05/09 14:54:28
base::string16 (for this and all other wstring in
chengx
2017/05/09 18:04:14
Done.
| |
| 191 | 225 |
| 192 // Timer for requesting delayed updates of the "Most Visited" category of | 226 // Timer for requesting delayed updates of the "Most Visited" category of |
| 193 // jumplist. | 227 // jumplist. |
| 194 base::OneShotTimer timer_most_visited_; | 228 base::OneShotTimer timer_most_visited_; |
| 195 | 229 |
| 196 // Timer for requesting delayed updates of the "Recently Closed" category of | 230 // Timer for requesting delayed updates of the "Recently Closed" category of |
| 197 // jumplist. | 231 // jumplist. |
| 198 base::OneShotTimer timer_recently_closed_; | 232 base::OneShotTimer timer_recently_closed_; |
| 199 | 233 |
| 200 // Holds data that can be accessed from multiple threads. | 234 // Holds data that can be accessed from multiple threads. |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 211 // JumpListIconsOld directory. | 245 // JumpListIconsOld directory. |
| 212 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; | 246 scoped_refptr<base::SequencedTaskRunner> delete_jumplisticons_task_runner_; |
| 213 | 247 |
| 214 // For callbacks may be run after destruction. | 248 // For callbacks may be run after destruction. |
| 215 base::WeakPtrFactory<JumpList> weak_ptr_factory_; | 249 base::WeakPtrFactory<JumpList> weak_ptr_factory_; |
| 216 | 250 |
| 217 DISALLOW_COPY_AND_ASSIGN(JumpList); | 251 DISALLOW_COPY_AND_ASSIGN(JumpList); |
| 218 }; | 252 }; |
| 219 | 253 |
| 220 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ | 254 #endif // CHROME_BROWSER_WIN_JUMPLIST_H_ |
| OLD | NEW |