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_PROFILE_CHOOSER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "chrome/browser/profiles/profile_metrics.h" | 13 #include "chrome/browser/profiles/profile_metrics.h" |
14 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 14 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
15 #include "chrome/browser/ui/profile_chooser_constants.h" | 15 #include "chrome/browser/ui/profile_chooser_constants.h" |
16 #include "components/signin/core/browser/signin_header_helper.h" | 16 #include "components/signin/core/browser/signin_header_helper.h" |
17 | 17 |
18 class AvatarMenu; | 18 class AvatarMenu; |
19 class ActiveProfileObserverBridge; | 19 class ActiveProfileObserverBridge; |
20 class Browser; | 20 class Browser; |
21 class ProfileOAuth2TokenService; | 21 class ProfileOAuth2TokenService; |
22 | 22 |
23 namespace content { | 23 namespace content { |
24 class WebContents; | 24 class WebContents; |
25 } | 25 } |
| 26 |
| 27 namespace signin_metrics { |
| 28 enum class AccessPoint; |
| 29 } |
| 30 |
26 class GaiaWebContentsDelegate; | 31 class GaiaWebContentsDelegate; |
27 | 32 |
28 // This window controller manages the bubble that displays a "menu" of profiles. | 33 // This window controller manages the bubble that displays a "menu" of profiles. |
29 // It is brought open by clicking on the avatar icon in the window frame. | 34 // It is brought open by clicking on the avatar icon in the window frame. |
30 @interface ProfileChooserController : BaseBubbleController<NSTextViewDelegate> { | 35 @interface ProfileChooserController : BaseBubbleController<NSTextViewDelegate> { |
31 @private | 36 @private |
32 // The menu that contains the data from the backend. | 37 // The menu that contains the data from the backend. |
33 scoped_ptr<AvatarMenu> avatarMenu_; | 38 scoped_ptr<AvatarMenu> avatarMenu_; |
34 | 39 |
35 // An observer to be notified when the OAuth2 tokens change or the avatar | 40 // An observer to be notified when the OAuth2 tokens change or the avatar |
(...skipping 21 matching lines...) Expand all Loading... |
57 | 62 |
58 // Web contents used by the inline signin view. | 63 // Web contents used by the inline signin view. |
59 scoped_ptr<content::WebContents> webContents_; | 64 scoped_ptr<content::WebContents> webContents_; |
60 scoped_ptr<GaiaWebContentsDelegate> webContentsDelegate_; | 65 scoped_ptr<GaiaWebContentsDelegate> webContentsDelegate_; |
61 | 66 |
62 // Whether the bubble is displayed for an active guest profile. | 67 // Whether the bubble is displayed for an active guest profile. |
63 BOOL isGuestSession_; | 68 BOOL isGuestSession_; |
64 | 69 |
65 // The GAIA service type that caused this menu to open. | 70 // The GAIA service type that caused this menu to open. |
66 signin::GAIAServiceType serviceType_; | 71 signin::GAIAServiceType serviceType_; |
| 72 |
| 73 // The current access point of sign in. |
| 74 signin_metrics::AccessPoint accessPoint_; |
67 } | 75 } |
68 | 76 |
69 - (id)initWithBrowser:(Browser*)browser | 77 - (id)initWithBrowser:(Browser*)browser |
70 anchoredAt:(NSPoint)point | 78 anchoredAt:(NSPoint)point |
71 viewMode:(profiles::BubbleViewMode)viewMode | 79 viewMode:(profiles::BubbleViewMode)viewMode |
72 tutorialMode:(profiles::TutorialMode)tutorialMode | 80 tutorialMode:(profiles::TutorialMode)tutorialMode |
73 serviceType:(signin::GAIAServiceType)GAIAServiceType; | 81 serviceType:(signin::GAIAServiceType)GAIAServiceType |
| 82 accessPoint:(signin_metrics::AccessPoint)accessPoint; |
74 | 83 |
75 // Creates all the subviews of the avatar bubble for |viewToDisplay|. | 84 // Creates all the subviews of the avatar bubble for |viewToDisplay|. |
76 - (void)initMenuContentsWithView:(profiles::BubbleViewMode)viewToDisplay; | 85 - (void)initMenuContentsWithView:(profiles::BubbleViewMode)viewToDisplay; |
77 | 86 |
78 // Returns the view currently displayed by the bubble. | 87 // Returns the view currently displayed by the bubble. |
79 - (profiles::BubbleViewMode)viewMode; | 88 - (profiles::BubbleViewMode)viewMode; |
80 | 89 |
81 // Sets the tutorial mode of the bubble. | 90 // Sets the tutorial mode of the bubble. |
82 - (void)setTutorialMode:(profiles::TutorialMode)tutorialMode; | 91 - (void)setTutorialMode:(profiles::TutorialMode)tutorialMode; |
83 | 92 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 @interface ProfileChooserController (ExposedForTesting) | 137 @interface ProfileChooserController (ExposedForTesting) |
129 - (id)initWithBrowser:(Browser*)browser | 138 - (id)initWithBrowser:(Browser*)browser |
130 anchoredAt:(NSPoint)point | 139 anchoredAt:(NSPoint)point |
131 viewMode:(profiles::BubbleViewMode)viewMode | 140 viewMode:(profiles::BubbleViewMode)viewMode |
132 tutorialMode:(profiles::TutorialMode)tutorialMode | 141 tutorialMode:(profiles::TutorialMode)tutorialMode |
133 serviceType:(signin::GAIAServiceType)GAIAServiceType; | 142 serviceType:(signin::GAIAServiceType)GAIAServiceType; |
134 - (IBAction)dismissTutorial:(id)sender; | 143 - (IBAction)dismissTutorial:(id)sender; |
135 @end | 144 @end |
136 | 145 |
137 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ | 146 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ |
OLD | NEW |