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_PROFILE_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "base/memory/scoped_nsobject.h" | 11 #include "base/memory/scoped_nsobject.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #import "chrome/browser/ui/cocoa/menu_controller.h" |
| 14 |
| 15 class ProfileMenuModel; |
12 | 16 |
13 // PopUp button that shows the multiprofile menu. | 17 // PopUp button that shows the multiprofile menu. |
14 @interface ProfileMenuButton : NSPopUpButton { | 18 @interface ProfileMenuButton : NSPopUpButton { |
15 @private | 19 @private |
16 BOOL shouldShowProfileDisplayName_; | 20 BOOL shouldShowProfileDisplayName_; |
17 scoped_nsobject<NSTextFieldCell> textFieldCell_; | 21 scoped_nsobject<NSTextFieldCell> textFieldCell_; |
18 | 22 |
19 scoped_nsobject<NSImage> cachedTabImage_; | 23 scoped_nsobject<NSImage> cachedTabImage_; |
20 // Cache the various button states when creating |cachedTabImage_|. If | 24 // Cache the various button states when creating |cachedTabImage_|. If |
21 // any of these states change then the cached image is invalidated. | 25 // any of these states change then the cached image is invalidated. |
22 BOOL cachedTabImageIsPressed_; | 26 BOOL cachedTabImageIsPressed_; |
| 27 |
| 28 // The popup menu and its model. |
| 29 scoped_nsobject<MenuController> menu_; |
| 30 scoped_ptr<ProfileMenuModel> profile_menu_model_; |
23 } | 31 } |
24 | 32 |
25 @property(assign,nonatomic) BOOL shouldShowProfileDisplayName; | 33 @property(assign,nonatomic) BOOL shouldShowProfileDisplayName; |
26 @property(assign,nonatomic) NSString* profileDisplayName; | 34 @property(assign,nonatomic) NSString* profileDisplayName; |
27 | 35 |
28 // Gets the size of the control that would display all its contents. | 36 // Gets the size of the control that would display all its contents. |
29 - (NSSize)desiredControlSize; | 37 - (NSSize)desiredControlSize; |
30 // Gets the minimum size that the control should be resized to. | 38 // Gets the minimum size that the control should be resized to. |
31 - (NSSize)minControlSize; | 39 - (NSSize)minControlSize; |
32 | 40 |
33 // Public for testing. | 41 // Public for testing. |
34 - (void) mouseDown:(NSEvent*)event | 42 - (void) mouseDown:(NSEvent*)event |
35 withShowMenuTarget:(id)target; | 43 withShowMenuTarget:(id)target; |
36 | 44 |
37 @end | 45 @end |
38 | 46 |
39 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_ | 47 #endif // CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_ |
OLD | NEW |