OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COCOA_HISTORY_MENU_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_COCOA_HISTORY_MENU_BRIDGE_H_ |
6 #define CHROME_BROWSER_COCOA_HISTORY_MENU_BRIDGE_H_ | 6 #define CHROME_BROWSER_COCOA_HISTORY_MENU_BRIDGE_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 // Favicon for the URL. | 81 // Favicon for the URL. |
82 scoped_nsobject<NSImage> icon; | 82 scoped_nsobject<NSImage> icon; |
83 | 83 |
84 // If the icon is being requested from the FaviconService, |icon_requested| | 84 // If the icon is being requested from the FaviconService, |icon_requested| |
85 // will be true and |icon_handle| will be non-NULL. If this is false, then | 85 // will be true and |icon_handle| will be non-NULL. If this is false, then |
86 // |icon_handle| will be NULL. | 86 // |icon_handle| will be NULL. |
87 bool icon_requested; | 87 bool icon_requested; |
88 // The Handle given to us by the FaviconService for the icon fetch request. | 88 // The Handle given to us by the FaviconService for the icon fetch request. |
89 FaviconService::Handle icon_handle; | 89 FaviconService::Handle icon_handle; |
90 | 90 |
91 // The pointer to the item after it has been created. Weak. | 91 // The pointer to the item after it has been created. This is co-owned with |
92 NSMenuItem* menu_item; | 92 // the NSMenu, but during a rebuild flood (if the user closes a lot of tabs |
John Grabowski
2010/06/17 19:30:44
This is co-owned with the NSMenu. but ...
-->
Str
| |
93 // quickly), the NSMenu can release the item before the HistoryItem has | |
94 // been fully deleted. If this were a weak pointer, it would result in a | |
95 // zombie. | |
96 scoped_nsobject<NSMenuItem> menu_item; | |
93 | 97 |
94 // This ID is unique for a browser session and can be passed to the | 98 // This ID is unique for a browser session and can be passed to the |
95 // TabRestoreService to re-open the closed window or tab that this | 99 // TabRestoreService to re-open the closed window or tab that this |
96 // references. A non-0 session ID indicates that this is an entry can be | 100 // references. A non-0 session ID indicates that this is an entry can be |
97 // restored that way. Otherwise, the URL will be used to open the item and | 101 // restored that way. Otherwise, the URL will be used to open the item and |
98 // this ID will be 0. | 102 // this ID will be 0. |
99 SessionID::id_type session_id; | 103 SessionID::id_type session_id; |
100 | 104 |
101 // If the HistoryItem is a window, this will be the vector of tabs. Note | 105 // If the HistoryItem is a window, this will be the vector of tabs. Note |
102 // that this is a list of weak references. The |menu_item_map_| is the owner | 106 // that this is a list of weak references. The |menu_item_map_| is the owner |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 bool create_in_progress_; | 230 bool create_in_progress_; |
227 bool need_recreate_; | 231 bool need_recreate_; |
228 | 232 |
229 // The default favicon if a HistoryItem does not have one. | 233 // The default favicon if a HistoryItem does not have one. |
230 scoped_nsobject<NSImage> default_favicon_; | 234 scoped_nsobject<NSImage> default_favicon_; |
231 | 235 |
232 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); | 236 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); |
233 }; | 237 }; |
234 | 238 |
235 #endif // CHROME_BROWSER_COCOA_HISTORY_MENU_BRIDGE_H_ | 239 #endif // CHROME_BROWSER_COCOA_HISTORY_MENU_BRIDGE_H_ |
OLD | NEW |