| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <vector> |
| 11 | 12 |
| 12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 13 #include "base/memory/scoped_nsobject.h" | 14 #include "base/memory/scoped_nsobject.h" |
| 14 #import "chrome/browser/favicon/favicon_service.h" | 15 #import "chrome/browser/favicon/favicon_service.h" |
| 15 #include "chrome/browser/history/history.h" | 16 #include "chrome/browser/history/history.h" |
| 16 #include "chrome/browser/sessions/session_id.h" | 17 #include "chrome/browser/sessions/session_id.h" |
| 17 #include "chrome/browser/sessions/tab_restore_service.h" | 18 #include "chrome/browser/sessions/tab_restore_service.h" |
| 18 #include "chrome/browser/sessions/tab_restore_service_observer.h" | 19 #include "chrome/browser/sessions/tab_restore_service_observer.h" |
| 19 #import "chrome/browser/ui/cocoa/main_menu_item.h" | 20 #import "chrome/browser/ui/cocoa/main_menu_item.h" |
| 20 #include "content/browser/cancelable_request.h" | 21 #include "content/browser/cancelable_request.h" |
| 21 #include "content/public/browser/notification_observer.h" | 22 #include "content/public/browser/notification_observer.h" |
| 22 | 23 |
| 23 class NavigationEntry; | |
| 24 class NotificationRegistrar; | 24 class NotificationRegistrar; |
| 25 class PageUsageData; | 25 class PageUsageData; |
| 26 class Profile; | 26 class Profile; |
| 27 class TabNavigationEntry; | |
| 28 class TabRestoreService; | 27 class TabRestoreService; |
| 29 @class HistoryMenuCocoaController; | 28 @class HistoryMenuCocoaController; |
| 30 | 29 |
| 31 namespace { | 30 namespace { |
| 32 | 31 |
| 33 class HistoryMenuBridgeTest; | 32 class HistoryMenuBridgeTest; |
| 34 | 33 |
| 35 } | 34 } // namespace |
| 36 | 35 |
| 37 // C++ bridge for the history menu; one per AppController (means there | 36 // C++ bridge for the history menu; one per AppController (means there |
| 38 // is only one). This class observes various data sources, namely the | 37 // is only one). This class observes various data sources, namely the |
| 39 // HistoryService and the TabRestoreService, and then updates the NSMenu when | 38 // HistoryService and the TabRestoreService, and then updates the NSMenu when |
| 40 // there is new data. | 39 // there is new data. |
| 41 // | 40 // |
| 42 // The history menu is broken up into sections: most visisted and recently | 41 // The history menu is broken up into sections: most visisted and recently |
| 43 // closed. The overall menu has a tag of IDC_HISTORY_MENU, with the user content | 42 // closed. The overall menu has a tag of IDC_HISTORY_MENU, with the user content |
| 44 // items having the local tags defined in the enum below. Items within a section | 43 // items having the local tags defined in the enum below. Items within a section |
| 45 // all share the same tag. The structure of the menu is laid out in MainMenu.xib | 44 // all share the same tag. The structure of the menu is laid out in MainMenu.xib |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 226 bool create_in_progress_; | 225 bool create_in_progress_; |
| 227 bool need_recreate_; | 226 bool need_recreate_; |
| 228 | 227 |
| 229 // The default favicon if a HistoryItem does not have one. | 228 // The default favicon if a HistoryItem does not have one. |
| 230 scoped_nsobject<NSImage> default_favicon_; | 229 scoped_nsobject<NSImage> default_favicon_; |
| 231 | 230 |
| 232 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); | 231 DISALLOW_COPY_AND_ASSIGN(HistoryMenuBridge); |
| 233 }; | 232 }; |
| 234 | 233 |
| 235 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ | 234 #endif // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_BRIDGE_H_ |
| OLD | NEW |