| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #import "base/mac/scoped_nsobject.h" | 10 #import "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" |
| 12 #import "ui/base/cocoa/menu_controller.h" | 13 #import "ui/base/cocoa/menu_controller.h" |
| 13 | 14 |
| 14 class BookmarkMenuBridge; | 15 class BookmarkMenuBridge; |
| 15 class Browser; | 16 class Browser; |
| 16 @class BrowserActionsContainerView; | 17 @class BrowserActionsContainerView; |
| 17 @class BrowserActionsController; | 18 @class BrowserActionsController; |
| 18 @class MenuTrackedRootView; | 19 @class MenuTrackedRootView; |
| 19 class RecentTabsMenuModelDelegate; | 20 class RecentTabsMenuModelDelegate; |
| 20 @class ToolbarController; | 21 @class ToolbarController; |
| 21 @class WrenchMenuButtonViewController; | 22 @class WrenchMenuButtonViewController; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 32 } // namespace WrenchMenuControllerInternal | 33 } // namespace WrenchMenuControllerInternal |
| 33 | 34 |
| 34 // The Wrench menu has a creative layout, with buttons in menu items. There is | 35 // The Wrench menu has a creative layout, with buttons in menu items. There is |
| 35 // a cross-platform model for this special menu, but on the Mac it's easier to | 36 // a cross-platform model for this special menu, but on the Mac it's easier to |
| 36 // get spacing and alignment precisely right using a NIB. To do that, we | 37 // get spacing and alignment precisely right using a NIB. To do that, we |
| 37 // subclass the generic MenuController implementation and special-case the two | 38 // subclass the generic MenuController implementation and special-case the two |
| 38 // items that require specific layout and load them from the NIB. | 39 // items that require specific layout and load them from the NIB. |
| 39 // | 40 // |
| 40 // This object is owned by the ToolbarController and receives its NIB-based | 41 // This object is owned by the ToolbarController and receives its NIB-based |
| 41 // views using the shim view controller below. | 42 // views using the shim view controller below. |
| 42 @interface WrenchMenuController : MenuController<NSMenuDelegate> { | 43 @interface WrenchMenuController |
| 44 : MenuController<NSMenuDelegate, HasWeakBrowserPointer> { |
| 43 @private | 45 @private |
| 44 // Used to provide accelerators for the menu. | 46 // Used to provide accelerators for the menu. |
| 45 scoped_ptr<WrenchMenuControllerInternal::AcceleratorDelegate> | 47 scoped_ptr<WrenchMenuControllerInternal::AcceleratorDelegate> |
| 46 acceleratorDelegate_; | 48 acceleratorDelegate_; |
| 47 | 49 |
| 48 // The model, rebuilt each time the |-menuNeedsUpdate:|. | 50 // The model, rebuilt each time the |-menuNeedsUpdate:|. |
| 49 scoped_ptr<WrenchMenuModel> wrenchMenuModel_; | 51 scoped_ptr<WrenchMenuModel> wrenchMenuModel_; |
| 50 | 52 |
| 51 // Used to update icons in the recent tabs menu. This must be declared after | 53 // Used to update icons in the recent tabs menu. This must be declared after |
| 52 // |wrenchMenuModel_| so that it gets deleted first. | 54 // |wrenchMenuModel_| so that it gets deleted first. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 IBOutlet MenuTrackedRootView* toolbarActionsOverflowItem; | 132 IBOutlet MenuTrackedRootView* toolbarActionsOverflowItem; |
| 131 @property(assign, nonatomic) | 133 @property(assign, nonatomic) |
| 132 IBOutlet BrowserActionsContainerView* overflowActionsContainerView; | 134 IBOutlet BrowserActionsContainerView* overflowActionsContainerView; |
| 133 | 135 |
| 134 - (id)initWithController:(WrenchMenuController*)controller; | 136 - (id)initWithController:(WrenchMenuController*)controller; |
| 135 - (IBAction)dispatchWrenchMenuCommand:(id)sender; | 137 - (IBAction)dispatchWrenchMenuCommand:(id)sender; |
| 136 | 138 |
| 137 @end | 139 @end |
| 138 | 140 |
| 139 #endif // CHROME_BROWSER_UI_COCOA_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ | 141 #endif // CHROME_BROWSER_UI_COCOA_WRENCH_MENU_WRENCH_MENU_CONTROLLER_H_ |
| OLD | NEW |