1 // Copyright (c) 2012 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.
5 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_
8 #import <Cocoa/Cocoa.h>
10 #include "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
16 typedef BackForwardMenuModel::ModelType BackForwardMenuType
;
17 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_BACK
=
18 BackForwardMenuModel::BACKWARD_MENU
;
19 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD
=
20 BackForwardMenuModel::FORWARD_MENU
;
22 // A class that manages the back/forward menu (and delayed-menu button, and
25 @interface BackForwardMenuController
: NSObject
<NSMenuDelegate
> {
27 BackForwardMenuType type_
;
28 MenuButton
* button_
; // Weak; comes from nib.
29 scoped_ptr
<BackForwardMenuModel
> model_
;
30 base::scoped_nsobject
<NSMenu
> backForwardMenu_
;
33 // Type (back or forwards); can only be set on initialization.
34 @
property(readonly
, nonatomic
) BackForwardMenuType type
;
36 - (id
)initWithBrowser
:(Browser
*)browser
37 modelType
:(BackForwardMenuType
)type
38 button
:(MenuButton
*)button
;
40 @end
// @interface BackForwardMenuController
42 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_