Chromium Code Reviews| Index: chrome/browser/ui/cocoa/extensions/browser_action_button.h |
| diff --git a/chrome/browser/ui/cocoa/extensions/browser_action_button.h b/chrome/browser/ui/cocoa/extensions/browser_action_button.h |
| index 66827da58c3f3e5a16fbf67f7bfe285fd9d6eb92..a68978b3dae7a5a17a4d4b797518c12b0540bfc0 100644 |
| --- a/chrome/browser/ui/cocoa/extensions/browser_action_button.h |
| +++ b/chrome/browser/ui/cocoa/extensions/browser_action_button.h |
| @@ -7,18 +7,17 @@ |
| #import <Cocoa/Cocoa.h> |
| +#include <string> |
| + |
| #import "base/mac/scoped_nsobject.h" |
| #include "base/memory/scoped_ptr.h" |
| #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| class Browser; |
| -class ExtensionAction; |
| +@class BrowserActionsController; |
| @class ExtensionActionContextMenuController; |
| -class ExtensionActionIconFactoryBridge; |
| - |
| -namespace extensions { |
| -class Extension; |
| -} |
| +class ToolbarActionViewController; |
| +class ToolbarActionViewDelegateBridge; |
| // Fired on each drag event while the user is moving the button. |
| extern NSString* const kBrowserActionButtonDraggingNotification; |
| @@ -27,18 +26,17 @@ extern NSString* const kBrowserActionButtonDragEndNotification; |
| @interface BrowserActionButton : NSButton<NSMenuDelegate> { |
| @private |
| - // Bridge to proxy Chrome notifications to the Obj-C class as well as load the |
| - // extension's icon. |
| - scoped_ptr<ExtensionActionIconFactoryBridge> iconFactoryBridge_; |
| - |
| // Used to move the button and query whether a button is currently animating. |
| base::scoped_nsobject<NSViewAnimation> moveAnimation_; |
| - // The extension for this button. Weak. |
| - const extensions::Extension* extension_; |
| + // The bridge between the view controller and this object. |
| + scoped_ptr<ToolbarActionViewDelegateBridge> viewControllerDelegate_; |
| + |
| + // The controller that handles most non-view logic. |
| + scoped_ptr<ToolbarActionViewController> viewController_; |
| - // The ID of the active tab. |
| - int tabId_; |
| + // The controller for the browser actions bar that owns this button. Weak. |
| + BrowserActionsController* browserActionsController_; |
| // Whether the button is currently being dragged. |
| BOOL isBeingDragged_; |
| @@ -57,9 +55,9 @@ extern NSString* const kBrowserActionButtonDragEndNotification; |
| } |
| - (id)initWithFrame:(NSRect)frame |
| - extension:(const extensions::Extension*)extension |
| - browser:(Browser*)browser |
| - tabId:(int)tabId; |
| + viewController:(scoped_ptr<ToolbarActionViewController>)viewController |
| + controller:(BrowserActionsController*)controller |
| + menuController:(ExtensionActionContextMenuController*)menuController; |
|
Avi (use Gerrit)
2014/10/30 23:21:25
What are the ownership semantics of the items bein
Devlin
2014/10/31 17:50:43
Ah, good point (related: just to confirm, there is
|
| - (void)setFrame:(NSRect)frameRect animate:(BOOL)animate; |
| @@ -67,27 +65,28 @@ extern NSString* const kBrowserActionButtonDragEndNotification; |
| - (BOOL)isAnimating; |
| +- (ToolbarActionViewController*)viewController; |
| + |
| // Returns a pointer to an autoreleased NSImage with the badge, shadow and |
| // cell image drawn into it. |
| - (NSImage*)compositedImage; |
| @property(readonly, nonatomic) BOOL isBeingDragged; |
| -@property(readonly, nonatomic) const extensions::Extension* extension; |
| -@property(readwrite, nonatomic) int tabId; |
| @end |
| @interface BrowserActionCell : ImageButtonCell { |
| @private |
| - // The current tab ID used when drawing the cell. |
| - int tabId_; |
| + // The controller for the browser actions bar that owns the button. Weak. |
| + BrowserActionsController* browserActionsController_; |
| - // The action we're drawing the cell for. Weak. |
| - ExtensionAction* extensionAction_; |
| + // The view controller for the parent button. Weak. |
| + ToolbarActionViewController* viewController_; |
| } |
| -@property(readwrite, nonatomic) int tabId; |
| -@property(readwrite, nonatomic) ExtensionAction* extensionAction; |
| +@property(assign, nonatomic) |
| + BrowserActionsController* browserActionsController; |
| +@property(readwrite, nonatomic) ToolbarActionViewController* viewController; |
| @end |