| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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_WRENCH_MENU_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #import "base/cocoa_protocols_mac.h" | 10 #import "base/cocoa_protocols_mac.h" |
| 11 #import "chrome/browser/cocoa/menu_controller.h" | 11 #import "chrome/browser/cocoa/menu_controller.h" |
| 12 | 12 |
| 13 @class MenuTrackedRootView; |
| 13 @class ToolbarController; | 14 @class ToolbarController; |
| 14 class WrenchMenuModel; | 15 class WrenchMenuModel; |
| 15 | 16 |
| 16 // The Wrench menu has a creative layout, with buttons in menu items. There is | 17 // The Wrench menu has a creative layout, with buttons in menu items. There is |
| 17 // a cross-platform model for this special menu, but on the Mac it's easier to | 18 // a cross-platform model for this special menu, but on the Mac it's easier to |
| 18 // get spacing and alignment precisely right using a NIB. To do that, we | 19 // get spacing and alignment precisely right using a NIB. To do that, we |
| 19 // subclass the generic MenuController implementation and special-case the two | 20 // subclass the generic MenuController implementation and special-case the two |
| 20 // items that require specific layout and load them from the NIB. | 21 // items that require specific layout and load them from the NIB. |
| 21 // | 22 // |
| 22 // This object is instantiated in Toolbar.xib and is configured by the | 23 // This object is instantiated in Toolbar.xib and is configured by the |
| 23 // ToolbarController. | 24 // ToolbarController. |
| 24 @interface WrenchMenuController : MenuController <NSMenuDelegate> { | 25 @interface WrenchMenuController : MenuController <NSMenuDelegate> { |
| 25 IBOutlet NSView* editItem_; | 26 IBOutlet MenuTrackedRootView* editItem_; |
| 26 IBOutlet NSSegmentedControl* editControl_; | 27 IBOutlet NSButton* editCut_; |
| 28 IBOutlet NSButton* editCopy_; |
| 29 IBOutlet NSButton* editPaste_; |
| 27 | 30 |
| 28 IBOutlet NSView* zoomItem_; | 31 IBOutlet MenuTrackedRootView* zoomItem_; |
| 29 IBOutlet NSButton* zoomPlus_; | 32 IBOutlet NSButton* zoomPlus_; |
| 30 IBOutlet NSButton* zoomDisplay_; | 33 IBOutlet NSButton* zoomDisplay_; |
| 31 IBOutlet NSButton* zoomMinus_; | 34 IBOutlet NSButton* zoomMinus_; |
| 32 IBOutlet NSButton* zoomFullScreen_; | 35 IBOutlet NSButton* zoomFullScreen_; |
| 33 } | 36 } |
| 34 | 37 |
| 35 // Designated initializer; called within the NIB. | 38 // Designated initializer; called within the NIB. |
| 36 - (id)init; | 39 - (id)init; |
| 37 | 40 |
| 38 // Used to dispatch commands from the Wrench menu. The custom items within the | 41 // Used to dispatch commands from the Wrench menu. The custom items within the |
| 39 // menu cannot be hooked up directly to First Responder because the window in | 42 // menu cannot be hooked up directly to First Responder because the window in |
| 40 // which the controls reside is not the BrowserWindowController, but a | 43 // which the controls reside is not the BrowserWindowController, but a |
| 41 // NSCarbonMenuWindow; this screws up the typical |-commandDispatch:| system. | 44 // NSCarbonMenuWindow; this screws up the typical |-commandDispatch:| system. |
| 42 - (IBAction)dispatchWrenchMenuCommand:(id)sender; | 45 - (IBAction)dispatchWrenchMenuCommand:(id)sender; |
| 43 | 46 |
| 44 // Inserts the update available notification menu item. | 47 // Inserts the update available notification menu item. |
| 45 - (void)insertUpdateAvailableItem; | 48 - (void)insertUpdateAvailableItem; |
| 46 | 49 |
| 47 @end | 50 @end |
| 48 | 51 |
| 49 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ | 52 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ |
| OLD | NEW |