Home | History | Annotate | Download | only in cocoa
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_
      6 #define CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_
      7 #pragma once
      8 
      9 #import <Cocoa/Cocoa.h>
     10 
     11 #include "base/memory/scoped_nsobject.h"
     12 
     13 // PopUp button that shows the multiprofile menu.
     14 @interface ProfileMenuButton : NSPopUpButton {
     15  @private
     16   BOOL shouldShowProfileDisplayName_;
     17   scoped_nsobject<NSTextFieldCell> textFieldCell_;
     18 
     19   scoped_nsobject<NSImage> cachedTabImage_;
     20   // Cache the various button states when creating |cachedTabImage_|. If
     21   // any of these states change then the cached image is invalidated.
     22   BOOL cachedTabImageIsPressed_;
     23 }
     24 
     25 @property(assign,nonatomic) BOOL shouldShowProfileDisplayName;
     26 @property(assign,nonatomic) NSString* profileDisplayName;
     27 
     28 // Gets the size of the control that would display all its contents.
     29 - (NSSize)desiredControlSize;
     30 // Gets the minimum size that the control should be resized to.
     31 - (NSSize)minControlSize;
     32 
     33 // Public for testing.
     34 - (void)   mouseDown:(NSEvent*)event
     35   withShowMenuTarget:(id)target;
     36 
     37 @end
     38 
     39 #endif  // CHROME_BROWSER_UI_COCOA_PROFILE_MENU_BUTTON_H_
     40