| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include "base/scoped_nsobject.h" | 10 #include "base/scoped_nsobject.h" |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/back_forward_menu_model.h" | 12 #include "chrome/browser/back_forward_menu_model.h" |
| 13 | 13 |
| 14 @class DelayedMenuButton; | 14 @class DelayedMenuButton; |
| 15 | 15 |
| 16 typedef BackForwardMenuModel::ModelType BackForwardMenuType; | 16 typedef BackForwardMenuModel::ModelType BackForwardMenuType; |
| 17 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_BACK = | 17 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_BACK = |
| 18 BackForwardMenuModel::BACKWARD_MENU; | 18 BackForwardMenuModel::BACKWARD_MENU; |
| 19 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD = | 19 const BackForwardMenuType BACK_FORWARD_MENU_TYPE_FORWARD = |
| 20 BackForwardMenuModel::FORWARD_MENU; | 20 BackForwardMenuModel::FORWARD_MENU; |
| 21 | 21 |
| 22 // A class that manages the back/forward menu (and delayed-menu button, and | 22 // A class that manages the back/forward menu (and delayed-menu button, and |
| 23 // model). | 23 // model). |
| 24 | 24 |
| 25 @interface BackForwardMenuController : NSObject { | 25 @interface BackForwardMenuController : NSObject { |
| 26 @private | 26 @private |
| 27 BackForwardMenuType type_; | 27 BackForwardMenuType type_; |
| 28 DelayedMenuButton* button_; // Weak; comes from nib. | 28 DelayedMenuButton* button_; // Weak; comes from nib. |
| 29 scoped_ptr<BackForwardMenuModel> model_; | 29 scoped_ptr<BackForwardMenuModel> model_; |
| 30 scoped_nsobject<NSMenu> menu_; | 30 scoped_nsobject<NSMenu> backForwardMenu_; |
| 31 } | 31 } |
| 32 | 32 |
| 33 // Type (back or forwards); can only be set on initialization. | 33 // Type (back or forwards); can only be set on initialization. |
| 34 @property(readonly, nonatomic) BackForwardMenuType type; | 34 @property(readonly, nonatomic) BackForwardMenuType type; |
| 35 | 35 |
| 36 - (id)initWithBrowser:(Browser*)browser | 36 - (id)initWithBrowser:(Browser*)browser |
| 37 modelType:(BackForwardMenuType)type | 37 modelType:(BackForwardMenuType)type |
| 38 button:(DelayedMenuButton*)button; | 38 button:(DelayedMenuButton*)button; |
| 39 | 39 |
| 40 @end // @interface BackForwardMenuController | 40 @end // @interface BackForwardMenuController |
| 41 | 41 |
| 42 #endif // CHROME_BROWSER_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ | 42 #endif // CHROME_BROWSER_COCOA_BACK_FORWARD_MENU_CONTROLLER_H_ |
| OLD | NEW |