| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_ACTION_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTION_BUTTON_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTION_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTION_BUTTON_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <memory> |
| 11 |
| 10 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
| 11 #include "base/memory/scoped_ptr.h" | |
| 12 #import "chrome/browser/ui/cocoa/image_button_cell.h" | 13 #import "chrome/browser/ui/cocoa/image_button_cell.h" |
| 13 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" | 14 #import "chrome/browser/ui/cocoa/toolbar/toolbar_button_cocoa.h" |
| 14 | 15 |
| 15 class Browser; | 16 class Browser; |
| 16 @class BrowserActionsController; | 17 @class BrowserActionsController; |
| 17 @class MenuController; | 18 @class MenuController; |
| 18 class ToolbarActionViewController; | 19 class ToolbarActionViewController; |
| 19 class ToolbarActionViewDelegateBridge; | 20 class ToolbarActionViewDelegateBridge; |
| 20 | 21 |
| 21 // Fired on each drag event while the user is moving the button. | 22 // Fired on each drag event while the user is moving the button. |
| 22 extern NSString* const kBrowserActionButtonDraggingNotification; | 23 extern NSString* const kBrowserActionButtonDraggingNotification; |
| 23 // Fired when the user drops the button. | 24 // Fired when the user drops the button. |
| 24 extern NSString* const kBrowserActionButtonDragEndNotification; | 25 extern NSString* const kBrowserActionButtonDragEndNotification; |
| 25 | 26 |
| 26 @interface BrowserActionButton : ToolbarButton<NSMenuDelegate> { | 27 @interface BrowserActionButton : ToolbarButton<NSMenuDelegate> { |
| 27 @private | 28 @private |
| 28 // Used to move the button and query whether a button is currently animating. | 29 // Used to move the button and query whether a button is currently animating. |
| 29 base::scoped_nsobject<NSViewAnimation> moveAnimation_; | 30 base::scoped_nsobject<NSViewAnimation> moveAnimation_; |
| 30 | 31 |
| 31 // The controller that handles most non-view logic. | 32 // The controller that handles most non-view logic. |
| 32 ToolbarActionViewController* viewController_; | 33 ToolbarActionViewController* viewController_; |
| 33 | 34 |
| 34 // The bridge between the view controller and this object. | 35 // The bridge between the view controller and this object. |
| 35 scoped_ptr<ToolbarActionViewDelegateBridge> viewControllerDelegate_; | 36 std::unique_ptr<ToolbarActionViewDelegateBridge> viewControllerDelegate_; |
| 36 | 37 |
| 37 // The context menu controller. | 38 // The context menu controller. |
| 38 base::scoped_nsobject<MenuController> contextMenuController_; | 39 base::scoped_nsobject<MenuController> contextMenuController_; |
| 39 | 40 |
| 40 // A substitute context menu to use in testing. We need this because normally | 41 // A substitute context menu to use in testing. We need this because normally |
| 41 // menu code is blocking, making it difficult to test. | 42 // menu code is blocking, making it difficult to test. |
| 42 NSMenu* testContextMenu_; | 43 NSMenu* testContextMenu_; |
| 43 | 44 |
| 44 // The controller for the browser actions bar that owns this button. Weak. | 45 // The controller for the browser actions bar that owns this button. Weak. |
| 45 BrowserActionsController* browserActionsController_; | 46 BrowserActionsController* browserActionsController_; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 // The controller for the browser actions bar that owns the button. Weak. | 107 // The controller for the browser actions bar that owns the button. Weak. |
| 107 BrowserActionsController* browserActionsController_; | 108 BrowserActionsController* browserActionsController_; |
| 108 } | 109 } |
| 109 | 110 |
| 110 @property(assign, nonatomic) | 111 @property(assign, nonatomic) |
| 111 BrowserActionsController* browserActionsController; | 112 BrowserActionsController* browserActionsController; |
| 112 | 113 |
| 113 @end | 114 @end |
| 114 | 115 |
| 115 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTION_BUTTON_H_ | 116 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_BROWSER_ACTION_BUTTON_H_ |
| OLD | NEW |