| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 kRecentlyClosedSeparator = 400, // Item before recently closed section. | 119 kRecentlyClosedSeparator = 400, // Item before recently closed section. |
| 120 kRecentlyClosedTitle = 401, // Title of recently closed section. | 120 kRecentlyClosedTitle = 401, // Title of recently closed section. |
| 121 kRecentlyClosed = 420, // Used for items in the recently closed section. | 121 kRecentlyClosed = 420, // Used for items in the recently closed section. |
| 122 kVisitedSeparator = 440, // Separator before visited section. | 122 kVisitedSeparator = 440, // Separator before visited section. |
| 123 kVisitedTitle = 441, // Title of the visited section. | 123 kVisitedTitle = 441, // Title of the visited section. |
| 124 kVisited = 460, // Used for all entries in the visited section. | 124 kVisited = 460, // Used for all entries in the visited section. |
| 125 kShowFullSeparator = 480 // Separator after the visited section. | 125 kShowFullSeparator = 480 // Separator after the visited section. |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 explicit HistoryMenuBridge(Profile* profile); | 128 explicit HistoryMenuBridge(Profile* profile); |
| 129 virtual ~HistoryMenuBridge(); | 129 ~HistoryMenuBridge() override; |
| 130 | 130 |
| 131 // content::NotificationObserver: | 131 // content::NotificationObserver: |
| 132 virtual void Observe(int type, | 132 void Observe(int type, |
| 133 const content::NotificationSource& source, | 133 const content::NotificationSource& source, |
| 134 const content::NotificationDetails& details) override; | 134 const content::NotificationDetails& details) override; |
| 135 | 135 |
| 136 // TabRestoreServiceObserver: | 136 // TabRestoreServiceObserver: |
| 137 virtual void TabRestoreServiceChanged(TabRestoreService* service) override; | 137 void TabRestoreServiceChanged(TabRestoreService* service) override; |
| 138 virtual void TabRestoreServiceDestroyed(TabRestoreService* service) override; | 138 void TabRestoreServiceDestroyed(TabRestoreService* service) override; |
| 139 | 139 |
| 140 // MainMenuItem: | 140 // MainMenuItem: |
| 141 virtual void ResetMenu() override; | 141 void ResetMenu() override; |
| 142 virtual void BuildMenu() override; | 142 void BuildMenu() override; |
| 143 | 143 |
| 144 // history::HistoryServiceObserver: | 144 // history::HistoryServiceObserver: |
| 145 virtual void OnURLVisited(HistoryService* history_service, | 145 void OnURLVisited(HistoryService* history_service, |
| 146 ui::PageTransition transition, | 146 ui::PageTransition transition, |
| 147 const history::URLRow& row, | 147 const history::URLRow& row, |
| 148 const history::RedirectList& redirects, | 148 const history::RedirectList& redirects, |
| 149 base::Time visit_time) override; | 149 base::Time visit_time) override; |
| 150 | 150 |
| 151 // Looks up an NSMenuItem in the |menu_item_map_| and returns the | 151 // Looks up an NSMenuItem in the |menu_item_map_| and returns the |
| 152 // corresponding HistoryItem. | 152 // corresponding HistoryItem. |
| 153 HistoryItem* HistoryItemForMenuItem(NSMenuItem* item); | 153 HistoryItem* HistoryItemForMenuItem(NSMenuItem* item); |
| 154 | 154 |
| 155 // I wish I has a "friend @class" construct. These are used by the HMCC | 155 // I wish I has a "friend @class" construct. These are used by the HMCC |
| 156 // to access model information when responding to actions. | 156 // to access model information when responding to actions. |
| 157 HistoryService* service(); | 157 HistoryService* service(); |
| 158 Profile* profile(); | 158 Profile* profile(); |
| 159 | 159 |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 bool create_in_progress_; | 235 bool create_in_progress_; |
| 236 bool need_recreate_; | 236 bool need_recreate_; |
| 237 | 237 |
| 238 // The default favicon if a HistoryItem does not have one. | 238 // The default favicon if a HistoryItem does not have one. |
| 239 base::scoped_nsobject<NSImage> default_favicon_; | 239 base::scoped_nsobject<NSImage> default_favicon_; |
| 240 | 240 |
| 241 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); | 241 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ | 244 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ |
| OLD | NEW |