Chromium Code Reviews| 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_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #include "base/scoped_nsobject.h" | 11 #include "base/scoped_nsobject.h" |
| 12 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 13 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
| 14 | 14 |
| 15 @class MenuButton; | 15 @class MenuButton; |
| 16 | 16 |
| 17 namespace BackForwardMenuControllerInternal { | |
| 18 // A C++ delegate that handles favicons as they are loaded from history. | |
| 19 class MenuDelegate; | |
| 20 } | |
| 21 | |
| 17 typedef BackForwardMenuModel::ModelType BackForwardMenuType; | 22 typedef BackForwardMenuModel::ModelType BackForwardMenuType; |
| 18 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_BACK = | 23 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_BACK = |
| 19 BackForwardMenuModel::BACKWARD_MENU; | 24 BackForwardMenuModel::BACKWARD_MENU; |
| 20 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD = | 25 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD = |
| 21 BackForwardMenuModel::FORWARD_MENU; | 26 BackForwardMenuModel::FORWARD_MENU; |
| 22 | 27 |
| 23 // A class that manages the back/forward menu (and delayed-menu button, and | 28 // A class that manages the back/forward menu (and delayed-menu button, and |
| 24 // model). | 29 // model). |
| 25 | 30 |
| 26 @interface BackForwardMenuController : NSObject { | 31 @interface BackForwardMenuController : NSObject { |
| 27 @private | 32 @private |
| 28 BackForwardMenuType type_; | 33 BackForwardMenuType type_; |
| 29 MenuButton* button_; // Weak; comes from nib. | 34 MenuButton* button_; // Weak; comes from nib. |
| 30 scoped_ptr<BackForwardMenuModel> model_; | 35 scoped_ptr<BackForwardMenuModel> model_; |
| 31 scoped_nsobject<NSMenu> backForwardMenu_; | 36 scoped_nsobject<NSMenu> backForwardMenu_; |
| 37 scoped_ptr<BackForwardMenuControllerInternal::MenuDelegate> | |
| 38 contextMenuDelegate_; | |
| 32 } | 39 } |
| 33 | 40 |
| 34 // Type (back or forwards); can only be set on initialization. | 41 // Type (back or forwards); can only be set on initialization. |
| 35 @property(readonly, nonatomic) BackForwardMenuType type; | 42 @property(readonly, nonatomic) BackForwardMenuType type; |
| 36 | 43 |
| 37 - (id)initWithBrowser:(Browser*)browser | 44 - (id)initWithBrowser:(Browser*)browser |
| 38 modelType:(BackForwardMenuType)type | 45 modelType:(BackForwardMenuType)type |
| 39 button:(MenuButton*)button; | 46 button:(MenuButton*)button; |
| 47 - (void)onIconChanged:(int) modelIndex; | |
|
Avi (use Gerrit)
2011/03/25 00:19:35
No space after the ).
| |
| 40 | 48 |
| 41 @end // @interface BackForwardMenuController | 49 @end // @interface BackForwardMenuController |
| 42 | 50 |
| 43 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ | 51 #endif // CHROME_BROWSER_UI_COCOA_TOOLBAR_BACK_FORWARD_MENU_CONTROLLER_H_ |
| OLD | NEW |