| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
| 10 | 10 |
| 11 #import "base/cocoa_protocols_mac.h" | 11 #import "base/cocoa_protocols_mac.h" |
| 12 #import "chrome/browser/cocoa/menu_controller.h" | 12 #import "chrome/browser/cocoa/menu_controller.h" |
| 13 | 13 |
| 14 @class MenuTrackedRootView; |
| 14 @class ToolbarController; | 15 @class ToolbarController; |
| 15 class WrenchMenuModel; | 16 class WrenchMenuModel; |
| 16 | 17 |
| 17 // The Wrench menu has a creative layout, with buttons in menu items. There is | 18 // The Wrench menu has a creative layout, with buttons in menu items. There is |
| 18 // a cross-platform model for this special menu, but on the Mac it's easier to | 19 // a cross-platform model for this special menu, but on the Mac it's easier to |
| 19 // get spacing and alignment precisely right using a NIB. To do that, we | 20 // get spacing and alignment precisely right using a NIB. To do that, we |
| 20 // subclass the generic MenuController implementation and special-case the two | 21 // subclass the generic MenuController implementation and special-case the two |
| 21 // items that require specific layout and load them from the NIB. | 22 // items that require specific layout and load them from the NIB. |
| 22 // | 23 // |
| 23 // This object is instantiated in Toolbar.xib and is configured by the | 24 // This object is instantiated in Toolbar.xib and is configured by the |
| 24 // ToolbarController. | 25 // ToolbarController. |
| 25 @interface WrenchMenuController : MenuController<NSMenuDelegate> { | 26 @interface WrenchMenuController : MenuController<NSMenuDelegate> { |
| 26 IBOutlet NSView* editItem_; | 27 IBOutlet MenuTrackedRootView* editItem_; |
| 27 IBOutlet NSSegmentedControl* editControl_; | 28 IBOutlet NSButton* editCut_; |
| 29 IBOutlet NSButton* editCopy_; |
| 30 IBOutlet NSButton* editPaste_; |
| 28 | 31 |
| 29 IBOutlet NSView* zoomItem_; | 32 IBOutlet MenuTrackedRootView* zoomItem_; |
| 30 IBOutlet NSButton* zoomPlus_; | 33 IBOutlet NSButton* zoomPlus_; |
| 31 IBOutlet NSButton* zoomDisplay_; | 34 IBOutlet NSButton* zoomDisplay_; |
| 32 IBOutlet NSButton* zoomMinus_; | 35 IBOutlet NSButton* zoomMinus_; |
| 33 IBOutlet NSButton* zoomFullScreen_; | 36 IBOutlet NSButton* zoomFullScreen_; |
| 34 } | 37 } |
| 35 | 38 |
| 36 // Designated initializer; called within the NIB. | 39 // Designated initializer; called within the NIB. |
| 37 - (id)init; | 40 - (id)init; |
| 38 | 41 |
| 39 // Used to dispatch commands from the Wrench menu. The custom items within the | 42 // Used to dispatch commands from the Wrench menu. The custom items within the |
| (...skipping 13 matching lines...) Expand all Loading... |
| 53 // |-dispatchWrenchMenuCommand:| calls this after it has determined the tag of | 56 // |-dispatchWrenchMenuCommand:| calls this after it has determined the tag of |
| 54 // the sender. The default implementation executes the command on the outermost | 57 // the sender. The default implementation executes the command on the outermost |
| 55 // run loop using |-performSelector...withDelay:|. This is not desirable in | 58 // run loop using |-performSelector...withDelay:|. This is not desirable in |
| 56 // unit tests because it's hard to test around run loops in a deterministic | 59 // unit tests because it's hard to test around run loops in a deterministic |
| 57 // manner. To avoid those headaches, tests should provide an alternative | 60 // manner. To avoid those headaches, tests should provide an alternative |
| 58 // implementation. | 61 // implementation. |
| 59 - (void)dispatchCommandInternal:(NSInteger)tag; | 62 - (void)dispatchCommandInternal:(NSInteger)tag; |
| 60 @end | 63 @end |
| 61 | 64 |
| 62 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ | 65 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ |
| OLD | NEW |