| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_COCOA_HISTORY_MENU_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ | 6 #define CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 HistoryItem* HistoryItemForTab(const TabRestoreService::Tab& entry); | 183 HistoryItem* HistoryItemForTab(const TabRestoreService::Tab& entry); |
| 184 | 184 |
| 185 // Helper function that sends an async request to the FaviconService to get | 185 // Helper function that sends an async request to the FaviconService to get |
| 186 // an icon. The callback will update the NSMenuItem directly. | 186 // an icon. The callback will update the NSMenuItem directly. |
| 187 void GetFaviconForHistoryItem(HistoryItem* item); | 187 void GetFaviconForHistoryItem(HistoryItem* item); |
| 188 | 188 |
| 189 // Callback for the FaviconService to return favicon image data when we | 189 // Callback for the FaviconService to return favicon image data when we |
| 190 // request it. This decodes the raw data, updates the HistoryItem, and then | 190 // request it. This decodes the raw data, updates the HistoryItem, and then |
| 191 // sets the image on the menu. Called on the same same thread that | 191 // sets the image on the menu. Called on the same same thread that |
| 192 // GetFaviconForHistoryItem() was called on (UI thread). | 192 // GetFaviconForHistoryItem() was called on (UI thread). |
| 193 void GotFaviconData(FaviconService::Handle handle, | 193 void GotFaviconData( |
| 194 history::FaviconData favicon); | 194 FaviconService::Handle handle, |
| 195 const history::FaviconImageResult& image_result); |
| 195 | 196 |
| 196 // Cancels a favicon load request for a given HistoryItem, if one is in | 197 // Cancels a favicon load request for a given HistoryItem, if one is in |
| 197 // progress. | 198 // progress. |
| 198 void CancelFaviconRequest(HistoryItem* item); | 199 void CancelFaviconRequest(HistoryItem* item); |
| 199 | 200 |
| 200 private: | 201 private: |
| 201 friend class ::HistoryMenuBridgeTest; | 202 friend class ::HistoryMenuBridgeTest; |
| 202 friend class HistoryMenuCocoaControllerTest; | 203 friend class HistoryMenuCocoaControllerTest; |
| 203 | 204 |
| 204 scoped_nsobject<HistoryMenuCocoaController> controller_; // strong | 205 scoped_nsobject<HistoryMenuCocoaController> controller_; // strong |
| (...skipping 19 matching lines...) Expand all Loading... |
| 224 bool create_in_progress_; | 225 bool create_in_progress_; |
| 225 bool need_recreate_; | 226 bool need_recreate_; |
| 226 | 227 |
| 227 // The default favicon if a HistoryItem does not have one. | 228 // The default favicon if a HistoryItem does not have one. |
| 228 scoped_nsobject<NSImage> default_favicon_; | 229 scoped_nsobject<NSImage> default_favicon_; |
| 229 | 230 |
| 230 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); | 231 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); |
| 231 }; | 232 }; |
| 232 | 233 |
| 233 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ | 234 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ |
| OLD | NEW |