Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_PROFILES_AVATAR_BASE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <AppKit/AppKit.h> | 8 #import <AppKit/AppKit.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 14 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" | 14 #import "chrome/browser/ui/cocoa/has_weak_browser_pointer.h" |
| 15 #include "components/signin/core/browser/signin_header_helper.h" | 15 #include "components/signin/core/browser/signin_header_helper.h" |
| 16 | 16 |
| 17 @class BaseBubbleController; | 17 @class BaseBubbleController; |
| 18 class Browser; | 18 class Browser; |
| 19 class ProfileAttributesUpdateObserver; | 19 class ProfileAttributesUpdateObserver; |
| 20 class SyncErrorObserver; | |
| 20 | 21 |
| 21 // This view controller manages the button that sits in the top of the | 22 // This view controller manages the button that sits in the top of the |
| 22 // window frame when using multi-profiles, and shows information about the | 23 // window frame when using multi-profiles, and shows information about the |
| 23 // current profile. Clicking the button will open the profile menu. | 24 // current profile. Clicking the button will open the profile menu. |
| 24 @interface AvatarBaseController : NSViewController<HasWeakBrowserPointer> { | 25 @interface AvatarBaseController : NSViewController<HasWeakBrowserPointer> { |
| 25 @protected | 26 @protected |
| 26 Browser* browser_; | 27 Browser* browser_; |
| 27 | 28 |
| 28 // The avatar button. Child classes are responsible for implementing it. | 29 // The avatar button. Child classes are responsible for implementing it. |
| 29 base::scoped_nsobject<NSButton> button_; | 30 base::scoped_nsobject<NSButton> button_; |
| 30 | 31 |
| 31 @private | 32 @private |
| 32 // The menu controller, if the menu is open. | 33 // The menu controller, if the menu is open. |
| 33 BaseBubbleController* menuController_; | 34 BaseBubbleController* menuController_; |
| 34 | 35 |
| 35 // Observer that listens for updates to the ProfileAttributesStorage. | 36 // Observer that listens for updates to the ProfileAttributesStorage. |
| 36 std::unique_ptr<ProfileAttributesUpdateObserver> profileAttributesObserver_; | 37 std::unique_ptr<ProfileAttributesUpdateObserver> profileAttributesObserver_; |
| 38 // Observer that listens for updates to the SyncErrorController. | |
|
groby-ooo-7-16
2016/07/22 23:53:15
Tiny style nit: Empty line above?
Jane
2016/08/03 19:57:57
Done.
| |
| 39 std::unique_ptr<SyncErrorObserver> syncErrorObserver_; | |
| 40 | |
| 41 BOOL hasAuthError_; | |
| 42 BOOL hasSyncError_; | |
| 37 } | 43 } |
| 38 | 44 |
| 39 // The avatar button view. | 45 // The avatar button view. |
| 40 @property(readonly, nonatomic) NSButton* buttonView; | 46 @property(readonly, nonatomic) NSButton* buttonView; |
| 41 | 47 |
| 42 // Designated initializer. | 48 // Designated initializer. |
| 43 - (id)initWithBrowser:(Browser*)browser; | 49 - (id)initWithBrowser:(Browser*)browser; |
| 44 | 50 |
| 45 // Shows the avatar bubble in the given mode. | 51 // Shows the avatar bubble in the given mode. |
| 46 - (void)showAvatarBubbleAnchoredAt:(NSView*)anchor | 52 - (void)showAvatarBubbleAnchoredAt:(NSView*)anchor |
| 47 withMode:(BrowserWindow::AvatarBubbleMode)mode | 53 withMode:(BrowserWindow::AvatarBubbleMode)mode |
| 48 withServiceType:(signin::GAIAServiceType)serviceType | 54 withServiceType:(signin::GAIAServiceType)serviceType |
| 49 fromAccessPoint:(signin_metrics::AccessPoint)accessPoint; | 55 fromAccessPoint:(signin_metrics::AccessPoint)accessPoint; |
| 50 | 56 |
| 51 @end | 57 @end |
| 52 | 58 |
| 53 @interface AvatarBaseController (ExposedForTesting) | 59 @interface AvatarBaseController (ExposedForTesting) |
| 54 - (BaseBubbleController*)menuController; | 60 - (BaseBubbleController*)menuController; |
| 55 | 61 |
| 56 - (BOOL)isCtrlPressed; | 62 - (BOOL)isCtrlPressed; |
| 57 @end | 63 @end |
| 58 | 64 |
| 59 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_ | 65 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_AVATAR_BASE_CONTROLLER_H_ |
| OLD | NEW |