Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / profiles / avatar_base_controller.h
blob01d25271ceae5799e667b58264ed9163a7d35b77
1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_
8 #import <AppKit/AppKit.h>
10 #import "base/mac/scoped_nsobject.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/browser_window.h"
13 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h"
14 #include "components/signin/core/browser/signin_header_helper.h"
16 @class BaseBubbleController;
17 class Browser;
18 class ProfileInfoUpdateObserver;
20 // This view controller manages the button that sits in the top of the
21 // window frame when using multi-profiles, and shows information about the
22 // current profile. Clicking the button will open the profile menu.
23 @interface AvatarBaseController : NSViewController<HasWeakBrowserPointer> {
24 @protected
25 Browser* browser_;
27 // The avatar button. Child classes are responsible for implementing it.
28 base::scoped_nsobject<NSButton> button_;
30 @private
31 // The menu controller, if the menu is open.
32 BaseBubbleController* menuController_;
34 // Observer that listens for updates to the ProfileInfoCache.
35 scoped_ptr<ProfileInfoUpdateObserver> profileInfoObserver_;
38 // The avatar button view.
39 @property(readonly, nonatomic) NSButton* buttonView;
41 // Designated initializer.
42 - (id)initWithBrowser:(Browser*)browser;
44 // Shows the avatar bubble in the given mode.
45 - (void)showAvatarBubbleAnchoredAt:(NSView*)anchor
46 withMode:(BrowserWindow::AvatarBubbleMode)mode
47 withServiceType:(signin::GAIAServiceType)serviceType;
49 @end
51 @interface AvatarBaseController (ExposedForTesting)
52 - (BaseBubbleController*)menuController;
54 - (BOOL)isCtrlPressed;
55 @end
57 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_