| 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_JUMPLIST_WIN_H_ | 5 #ifndef CHROME_BROWSER_JUMPLIST_WIN_H_ |
| 6 #define CHROME_BROWSER_JUMPLIST_WIN_H_ | 6 #define CHROME_BROWSER_JUMPLIST_WIN_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 const content::NotificationDetails& details); | 63 const content::NotificationDetails& details); |
| 64 | 64 |
| 65 // Registers (or unregisters) this object as an observer. | 65 // Registers (or unregisters) this object as an observer. |
| 66 // When the TabRestoreService object notifies the tab status is changed, this | 66 // When the TabRestoreService object notifies the tab status is changed, this |
| 67 // class automatically updates an application JumpList. | 67 // class automatically updates an application JumpList. |
| 68 bool AddObserver(Profile* profile); | 68 bool AddObserver(Profile* profile); |
| 69 void RemoveObserver(); | 69 void RemoveObserver(); |
| 70 | 70 |
| 71 // Observer callback for TabRestoreService::Observer to notify when a tab is | 71 // Observer callback for TabRestoreService::Observer to notify when a tab is |
| 72 // added or removed. | 72 // added or removed. |
| 73 // This function sends a query that retrieves "Most Visited" pages to | |
| 74 // HistoryService. When the query finishes successfully, HistoryService call | |
| 75 // OnSegmentUsageAvailable(). | |
| 76 virtual void TabRestoreServiceChanged(TabRestoreService* service); | 73 virtual void TabRestoreServiceChanged(TabRestoreService* service); |
| 77 | 74 |
| 78 // Observer callback to notice when our associated TabRestoreService | 75 // Observer callback to notice when our associated TabRestoreService |
| 79 // is destroyed. | 76 // is destroyed. |
| 80 virtual void TabRestoreServiceDestroyed(TabRestoreService* service); | 77 virtual void TabRestoreServiceDestroyed(TabRestoreService* service); |
| 81 | 78 |
| 82 // Cancel a pending jumplist update. | 79 // Cancel a pending jumplist update. |
| 83 void CancelPendingUpdate(); | 80 void CancelPendingUpdate(); |
| 84 | 81 |
| 85 // Terminate the jumplist: cancel any pending updates and remove observer | 82 // Terminate the jumplist: cancel any pending updates and remove observer |
| (...skipping 16 matching lines...) Expand all Loading... |
| 102 void AddWindow(const TabRestoreService::Window* window, | 99 void AddWindow(const TabRestoreService::Window* window, |
| 103 ShellLinkItemList* list, | 100 ShellLinkItemList* list, |
| 104 size_t max_items); | 101 size_t max_items); |
| 105 | 102 |
| 106 // Starts loading a favicon for each URL in |icon_urls_|. | 103 // Starts loading a favicon for each URL in |icon_urls_|. |
| 107 // This function sends a query to HistoryService. | 104 // This function sends a query to HistoryService. |
| 108 // When finishing loading all favicons, this function posts a task that | 105 // When finishing loading all favicons, this function posts a task that |
| 109 // decompresses collected favicons and updates a JumpList. | 106 // decompresses collected favicons and updates a JumpList. |
| 110 void StartLoadingFavicon(); | 107 void StartLoadingFavicon(); |
| 111 | 108 |
| 112 // A callback function for HistoryService that notify when the "Most Visited" | |
| 113 // list is available. | |
| 114 // This function updates the ShellLinkItemList objects and send another query | |
| 115 // that retrieves a favicon for each URL in the list. | |
| 116 void OnSegmentUsageAvailable(CancelableRequestProvider::Handle handle, | |
| 117 std::vector<PageUsageData*>* data); | |
| 118 | |
| 119 // A callback function for HistoryService that notify when a requested favicon | 109 // A callback function for HistoryService that notify when a requested favicon |
| 120 // is available. | 110 // is available. |
| 121 // To avoid file operations, this function just attaches the given data to | 111 // To avoid file operations, this function just attaches the given data to |
| 122 // a ShellLinkItem object. | 112 // a ShellLinkItem object. |
| 123 void OnFaviconDataAvailable( | 113 void OnFaviconDataAvailable( |
| 124 const favicon_base::FaviconImageResult& image_result); | 114 const favicon_base::FaviconImageResult& image_result); |
| 125 | 115 |
| 126 // Callback for TopSites that notifies when the "Most | 116 // Callback for TopSites that notifies when the "Most |
| 127 // Visited" list is available. This function updates the ShellLinkItemList | 117 // Visited" list is available. This function updates the ShellLinkItemList |
| 128 // objects and send another query that retrieves a favicon for each URL in | 118 // objects and send another query that retrieves a favicon for each URL in |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 base::CancelableTaskTracker::TaskId task_id_; | 170 base::CancelableTaskTracker::TaskId task_id_; |
| 181 | 171 |
| 182 // Lock for most_visited_pages_, recently_closed_pages_, icon_urls_ | 172 // Lock for most_visited_pages_, recently_closed_pages_, icon_urls_ |
| 183 // as they may be used by up to 3 threads. | 173 // as they may be used by up to 3 threads. |
| 184 base::Lock list_lock_; | 174 base::Lock list_lock_; |
| 185 | 175 |
| 186 DISALLOW_COPY_AND_ASSIGN(JumpList); | 176 DISALLOW_COPY_AND_ASSIGN(JumpList); |
| 187 }; | 177 }; |
| 188 | 178 |
| 189 #endif // CHROME_BROWSER_JUMPLIST_WIN_H_ | 179 #endif // CHROME_BROWSER_JUMPLIST_WIN_H_ |
| OLD | NEW |