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 #include "chrome/browser/signin/signin_header_helper.h" | 14 #include "chrome/browser/signin/signin_header_helper.h" |
15 #include "chrome/browser/ui/profile_chooser_constants.h" | 15 #include "chrome/browser/ui/profile_chooser_constants.h" |
16 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 16 #import "chrome/browser/ui/cocoa/base_bubble_controller.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 class GaiaWebContentsDelegate; | |
26 | 27 |
27 // This window controller manages the bubble that displays a "menu" of profiles. | 28 // This window controller manages the bubble that displays a "menu" of profiles. |
28 // It is brought open by clicking on the avatar icon in the window frame. | 29 // It is brought open by clicking on the avatar icon in the window frame. |
29 @interface ProfileChooserController : BaseBubbleController<NSTextViewDelegate> { | 30 @interface ProfileChooserController : BaseBubbleController<NSTextViewDelegate> { |
30 @private | 31 @private |
31 // The menu that contains the data from the backend. | 32 // The menu that contains the data from the backend. |
32 scoped_ptr<AvatarMenu> avatarMenu_; | 33 scoped_ptr<AvatarMenu> avatarMenu_; |
33 | 34 |
34 // An observer to be notified when the OAuth2 tokens change or the avatar | 35 // An observer to be notified when the OAuth2 tokens change or the avatar |
35 // menu model updates for the active profile. | 36 // menu model updates for the active profile. |
(...skipping 13 matching lines...) Expand all Loading... | |
49 // The current tutorial mode. | 50 // The current tutorial mode. |
50 profiles::TutorialMode tutorialMode_; | 51 profiles::TutorialMode tutorialMode_; |
51 | 52 |
52 // List of the full, un-elided accounts for the active profile. The keys are | 53 // List of the full, un-elided accounts for the active profile. The keys are |
53 // generated used to tag the UI buttons, and the values are the original | 54 // generated used to tag the UI buttons, and the values are the original |
54 // emails displayed by the buttons. | 55 // emails displayed by the buttons. |
55 std::map<int, std::string> currentProfileAccounts_; | 56 std::map<int, std::string> currentProfileAccounts_; |
56 | 57 |
57 // Web contents used by the inline signin view. | 58 // Web contents used by the inline signin view. |
58 scoped_ptr<content::WebContents> webContents_; | 59 scoped_ptr<content::WebContents> webContents_; |
60 scoped_ptr<GaiaWebContentsDelegate> webContentsDelegate_; | |
Alexei Svitkine (slow)
2014/10/28 18:27:23
Does this need to be a scoped ptr, or can it just
guohui
2014/10/28 18:53:40
By using the scoped pointer, we only instantiate w
| |
59 | 61 |
60 // Whether the bubble is displayed for an active guest profile. | 62 // Whether the bubble is displayed for an active guest profile. |
61 BOOL isGuestSession_; | 63 BOOL isGuestSession_; |
62 | 64 |
63 // The GAIA service type that caused this menu to open. | 65 // The GAIA service type that caused this menu to open. |
64 signin::GAIAServiceType serviceType_; | 66 signin::GAIAServiceType serviceType_; |
65 } | 67 } |
66 | 68 |
67 - (id)initWithBrowser:(Browser*)browser | 69 - (id)initWithBrowser:(Browser*)browser |
68 anchoredAt:(NSPoint)point | 70 anchoredAt:(NSPoint)point |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 127 |
126 @interface ProfileChooserController (ExposedForTesting) | 128 @interface ProfileChooserController (ExposedForTesting) |
127 - (id)initWithBrowser:(Browser*)browser | 129 - (id)initWithBrowser:(Browser*)browser |
128 anchoredAt:(NSPoint)point | 130 anchoredAt:(NSPoint)point |
129 viewMode:(profiles::BubbleViewMode)viewMode | 131 viewMode:(profiles::BubbleViewMode)viewMode |
130 tutorialMode:(profiles::TutorialMode)tutorialMode | 132 tutorialMode:(profiles::TutorialMode)tutorialMode |
131 serviceType:(signin::GAIAServiceType)GAIAServiceType; | 133 serviceType:(signin::GAIAServiceType)GAIAServiceType; |
132 @end | 134 @end |
133 | 135 |
134 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ | 136 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ |
OLD | NEW |