Chromium Code Reviews| 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 |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 IBOutlet NSButton* editCut_; | 33 IBOutlet NSButton* editCut_; |
| 34 IBOutlet NSButton* editCopy_; | 34 IBOutlet NSButton* editCopy_; |
| 35 IBOutlet NSButton* editPaste_; | 35 IBOutlet NSButton* editPaste_; |
| 36 | 36 |
| 37 IBOutlet MenuTrackedRootView* zoomItem_; | 37 IBOutlet MenuTrackedRootView* zoomItem_; |
| 38 IBOutlet NSButton* zoomPlus_; | 38 IBOutlet NSButton* zoomPlus_; |
| 39 IBOutlet NSButton* zoomDisplay_; | 39 IBOutlet NSButton* zoomDisplay_; |
| 40 IBOutlet NSButton* zoomMinus_; | 40 IBOutlet NSButton* zoomMinus_; |
| 41 IBOutlet NSButton* zoomFullScreen_; | 41 IBOutlet NSButton* zoomFullScreen_; |
| 42 | 42 |
| 43 WrenchMenuModel* wrench_model_; | |
|
Robert Sesek
2010/08/24 00:31:13
Unnecessary. The MenuController already maintains
Robert Sesek
2010/08/24 15:28:07
Name this wrenchMenuModel_ and add a comment as to
| |
| 44 | |
| 43 scoped_ptr<WrenchMenuControllerInternal::ZoomLevelObserver> observer_; | 45 scoped_ptr<WrenchMenuControllerInternal::ZoomLevelObserver> observer_; |
| 44 } | 46 } |
| 45 | 47 |
|
Robert Sesek
2010/08/24 15:28:07
Add: @property (nonatomic, assign) WrenchMenuModel
| |
| 46 // Designated initializer; called within the NIB. | 48 // Designated initializer; called within the NIB. |
| 47 - (id)init; | 49 - (id)init; |
| 48 | 50 |
| 51 - (void)setWrenchMenuModel:(WrenchMenuModel*)model; | |
|
Robert Sesek
2010/08/24 00:31:13
Remove.
Robert Sesek
2010/08/24 15:28:07
Still remove this proto.
| |
| 52 | |
| 49 // Used to dispatch commands from the Wrench menu. The custom items within the | 53 // Used to dispatch commands from the Wrench menu. The custom items within the |
| 50 // menu cannot be hooked up directly to First Responder because the window in | 54 // menu cannot be hooked up directly to First Responder because the window in |
| 51 // which the controls reside is not the BrowserWindowController, but a | 55 // which the controls reside is not the BrowserWindowController, but a |
| 52 // NSCarbonMenuWindow; this screws up the typical |-commandDispatch:| system. | 56 // NSCarbonMenuWindow; this screws up the typical |-commandDispatch:| system. |
| 53 - (IBAction)dispatchWrenchMenuCommand:(id)sender; | 57 - (IBAction)dispatchWrenchMenuCommand:(id)sender; |
| 54 | 58 |
| 55 // Returns the weak reference to the WrenchMenuModel. | 59 // Returns the weak reference to the WrenchMenuModel. |
| 56 - (WrenchMenuModel*)wrenchMenuModel; | 60 - (WrenchMenuModel*)wrenchMenuModel; |
| 57 | 61 |
| 58 // Inserts the update available notification menu item. | |
| 59 - (void)insertUpdateAvailableItem; | |
| 60 | |
| 61 @end | 62 @end |
| 62 | 63 |
| 63 //////////////////////////////////////////////////////////////////////////////// | 64 //////////////////////////////////////////////////////////////////////////////// |
| 64 | 65 |
| 65 @interface WrenchMenuController (UnitTesting) | 66 @interface WrenchMenuController (UnitTesting) |
| 66 // |-dispatchWrenchMenuCommand:| calls this after it has determined the tag of | 67 // |-dispatchWrenchMenuCommand:| calls this after it has determined the tag of |
| 67 // the sender. The default implementation executes the command on the outermost | 68 // the sender. The default implementation executes the command on the outermost |
| 68 // run loop using |-performSelector...withDelay:|. This is not desirable in | 69 // run loop using |-performSelector...withDelay:|. This is not desirable in |
| 69 // unit tests because it's hard to test around run loops in a deterministic | 70 // unit tests because it's hard to test around run loops in a deterministic |
| 70 // manner. To avoid those headaches, tests should provide an alternative | 71 // manner. To avoid those headaches, tests should provide an alternative |
| 71 // implementation. | 72 // implementation. |
| 72 - (void)dispatchCommandInternal:(NSInteger)tag; | 73 - (void)dispatchCommandInternal:(NSInteger)tag; |
| 73 @end | 74 @end |
| 74 | 75 |
| 75 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ | 76 #endif // CHROME_BROWSER_COCOA_WRENCH_MENU_CONTROLLER_H_ |
| OLD | NEW |