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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_COCOA_HISTORY_MENU_COCOA_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_HISTORY_MENU_COCOA_CONTROLLER_H_
7 
8 #import <Cocoa/Cocoa.h>
9 #import "chrome/browser/ui/cocoa/history_menu_bridge.h"
10 
11 // Controller (MVC) for the history menu. All history menu item commands get
12 // directed here. This class only responds to menu events, but the actual
13 // creation and maintenance of the menu happens in the Bridge.
14 @interface HistoryMenuCocoaController : NSObject<NSMenuDelegate> {
15  @private
16   HistoryMenuBridge* _bridge;  // weak; owns us
17 }
18 
19 - (id)initWithBridge:(HistoryMenuBridge*)bridge;
20 
21 // Called by any history menu item.
22 - (IBAction)openHistoryMenuItem:(id)sender;
23 
24 @end  // HistoryMenuCocoaController
25 
26 @interface HistoryMenuCocoaController (ExposedForUnitTests)
27 - (void)openURLForItem:(const HistoryMenuBridge::HistoryItem*)node;
28 @end  // HistoryMenuCocoaController (ExposedForUnitTests)
29 
30 #endif  // CHROME_BROWSER_UI_COCOA_HISTORY_MENU_COCOA_CONTROLLER_H_
31