Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(208)

Side by Side Diff: chrome/browser/ui/cocoa/profile_menu_button.h

Issue 7054031: Mac: Use cross-platform menu model for profile button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/profile_menu_button.mm » ('j') | chrome/browser/ui/profile_menu_model.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698