summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa/profile_menu_button.h
blob: ca5dc8277e7a1c75c6608aebd6caf530eae61e56 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_
#define CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_
#pragma once

#import <Cocoa/Cocoa.h>

#include "base/memory/scoped_nsobject.h"

// PopUp button that shows the multiprofile menu.
@interface ProfileMenuButton : NSPopUpButton {
 @private
  BOOL shouldShowProfileDisplayName_;
  scoped_nsobject<NSTextFieldCell> textFieldCell_;

  scoped_nsobject<NSImage> cachedTabImage_;
  // Cache the various button states when creating |cachedTabImage_|. If
  // any of these states change then the cached image is invalidated.
  BOOL cachedTabImageIsPressed_;
}

@property(assign,nonatomic) BOOL shouldShowProfileDisplayName;
@property(assign,nonatomic) NSString* profileDisplayName;

// Gets the size of the control that would display all its contents.
- (NSSize)desiredControlSize;
// Gets the minimum size that the control should be resized to.
- (NSSize)minControlSize;

// Public for testing.
- (void)   mouseDown:(NSEvent*)event
  withShowMenuTarget:(id)target;

@end

#endif  // CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_