OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_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 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
13 | 14 |
14 class Browser; | 15 class Browser; |
15 @class BrowserActionButton; | 16 @class BrowserActionButton; |
16 @class BrowserActionsContainerView; | 17 @class BrowserActionsContainerView; |
17 @class MenuButton; | 18 @class MenuButton; |
18 class ToolbarActionsBar; | 19 class ToolbarActionsBar; |
19 @class ToolbarActionsBarBubbleMac; | 20 @class ToolbarActionsBarBubbleMac; |
20 class ToolbarActionsBarDelegate; | 21 class ToolbarActionsBarDelegate; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 class WebContents; | 24 class WebContents; |
24 } | 25 } |
25 | 26 |
26 // Sent when the visibility of the Browser Actions changes. | 27 // Sent when the visibility of the Browser Actions changes. |
27 extern NSString* const kBrowserActionVisibilityChangedNotification; | 28 extern NSString* const kBrowserActionVisibilityChangedNotification; |
28 | 29 |
29 // Handles state and provides an interface for controlling the Browser Actions | 30 // Handles state and provides an interface for controlling the Browser Actions |
30 // container within the Toolbar. | 31 // container within the Toolbar. |
31 @interface BrowserActionsController : NSObject<NSMenuDelegate> { | 32 @interface BrowserActionsController |
| 33 : NSObject<NSMenuDelegate, HasWeakBrowserPointer> { |
32 @private | 34 @private |
33 // Reference to the current browser. Weak. | 35 // Reference to the current browser. Weak. |
34 Browser* browser_; | 36 Browser* browser_; |
35 | 37 |
36 // The view from Toolbar.xib we'll be rendering our browser actions in. Weak. | 38 // The view from Toolbar.xib we'll be rendering our browser actions in. Weak. |
37 BrowserActionsContainerView* containerView_; | 39 BrowserActionsContainerView* containerView_; |
38 | 40 |
39 // Array of toolbar action buttons in the correct order for them to be | 41 // Array of toolbar action buttons in the correct order for them to be |
40 // displayed (includes both hidden and visible buttons). | 42 // displayed (includes both hidden and visible buttons). |
41 base::scoped_nsobject<NSMutableArray> buttons_; | 43 base::scoped_nsobject<NSMutableArray> buttons_; |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // Sets whether or not the overflow container is focused in the wrench menu. | 122 // Sets whether or not the overflow container is focused in the wrench menu. |
121 - (void)setFocusedInOverflow:(BOOL)focused; | 123 - (void)setFocusedInOverflow:(BOOL)focused; |
122 | 124 |
123 @end // @interface BrowserActionsController | 125 @end // @interface BrowserActionsController |
124 | 126 |
125 @interface BrowserActionsController(TestingAPI) | 127 @interface BrowserActionsController(TestingAPI) |
126 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index; | 128 - (BrowserActionButton*)buttonWithIndex:(NSUInteger)index; |
127 @end | 129 @end |
128 | 130 |
129 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_ | 131 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTIONS_CONTROLLER_H_ |
OLD | NEW |