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" |
| 14 #include "chrome/browser/signin/signin_header_helper.h" |
13 #include "chrome/browser/ui/profile_chooser_constants.h" | 15 #include "chrome/browser/ui/profile_chooser_constants.h" |
14 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 16 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
15 | 17 |
16 class AvatarMenu; | 18 class AvatarMenu; |
17 class ActiveProfileObserverBridge; | 19 class ActiveProfileObserverBridge; |
18 class Browser; | 20 class Browser; |
19 class ProfileOAuth2TokenService; | 21 class ProfileOAuth2TokenService; |
20 | 22 |
21 namespace content { | 23 namespace content { |
22 class WebContents; | 24 class WebContents; |
(...skipping 27 matching lines...) Expand all Loading... |
50 // List of the full, un-elided accounts for the active profile. The keys are | 52 // List of the full, un-elided accounts for the active profile. The keys are |
51 // generated used to tag the UI buttons, and the values are the original | 53 // generated used to tag the UI buttons, and the values are the original |
52 // emails displayed by the buttons. | 54 // emails displayed by the buttons. |
53 std::map<int, std::string> currentProfileAccounts_; | 55 std::map<int, std::string> currentProfileAccounts_; |
54 | 56 |
55 // Web contents used by the inline signin view. | 57 // Web contents used by the inline signin view. |
56 scoped_ptr<content::WebContents> webContents_; | 58 scoped_ptr<content::WebContents> webContents_; |
57 | 59 |
58 // Whether the bubble is displayed for an active guest profile. | 60 // Whether the bubble is displayed for an active guest profile. |
59 BOOL isGuestSession_; | 61 BOOL isGuestSession_; |
| 62 |
| 63 // The GAIA service type that caused this menu to open. |
| 64 signin::GAIAServiceType serviceType_; |
60 } | 65 } |
61 | 66 |
62 - (id)initWithBrowser:(Browser*)browser | 67 - (id)initWithBrowser:(Browser*)browser |
63 anchoredAt:(NSPoint)point | 68 anchoredAt:(NSPoint)point |
64 withMode:(profiles::BubbleViewMode)mode; | 69 withMode:(profiles::BubbleViewMode)mode |
| 70 withServiceType:(signin::GAIAServiceType)GAIAServiceType; |
65 | 71 |
66 // Creates all the subviews of the avatar bubble for |viewToDisplay|. | 72 // Creates all the subviews of the avatar bubble for |viewToDisplay|. |
67 - (void)initMenuContentsWithView:(profiles::BubbleViewMode)viewToDisplay; | 73 - (void)initMenuContentsWithView:(profiles::BubbleViewMode)viewToDisplay; |
68 | 74 |
69 // Returns the view currently displayed by the bubble. | 75 // Returns the view currently displayed by the bubble. |
70 - (profiles::BubbleViewMode)viewMode; | 76 - (profiles::BubbleViewMode)viewMode; |
71 | 77 |
72 // Switches to a given profile. |sender| is an ProfileChooserItemController. | 78 // Switches to a given profile. |sender| is an ProfileChooserItemController. |
73 - (IBAction)switchToProfile:(id)sender; | 79 - (IBAction)switchToProfile:(id)sender; |
74 | 80 |
(...skipping 23 matching lines...) Expand all Loading... |
98 | 104 |
99 // Shows the account removal view to confirm removing the currently selected | 105 // Shows the account removal view to confirm removing the currently selected |
100 // account from the active profile if possible. | 106 // account from the active profile if possible. |
101 - (IBAction)showAccountRemovalView:(id)sender; | 107 - (IBAction)showAccountRemovalView:(id)sender; |
102 | 108 |
103 // Removes the current account |accountIdToRemove_|. | 109 // Removes the current account |accountIdToRemove_|. |
104 - (IBAction)removeAccount:(id)sender; | 110 - (IBAction)removeAccount:(id)sender; |
105 | 111 |
106 // Reset the WebContents used by the Gaia embedded view. | 112 // Reset the WebContents used by the Gaia embedded view. |
107 - (void)cleanUpEmbeddedViewContents; | 113 - (void)cleanUpEmbeddedViewContents; |
| 114 |
| 115 // Clean-up done after an action was performed in the ProfileChooser. |
| 116 - (void)postActionPerformed:(ProfileMetrics::ProfileDesktopMenu)action; |
108 @end | 117 @end |
109 | 118 |
110 // Testing API ///////////////////////////////////////////////////////////////// | 119 // Testing API ///////////////////////////////////////////////////////////////// |
111 | 120 |
112 @interface ProfileChooserController (ExposedForTesting) | 121 @interface ProfileChooserController (ExposedForTesting) |
113 - (id)initWithBrowser:(Browser*)browser | 122 - (id)initWithBrowser:(Browser*)browser |
114 anchoredAt:(NSPoint)point | 123 anchoredAt:(NSPoint)point |
115 withMode:(profiles::BubbleViewMode)mode; | 124 withMode:(profiles::BubbleViewMode)mode |
| 125 withServiceType:(signin::GAIAServiceType)serviceType; |
116 @end | 126 @end |
117 | 127 |
118 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ | 128 #endif // CHROME_BROWSER_UI_COCOA_PROFILES_PROFILE_CHOOSER_CONTROLLER_H_ |
OLD | NEW |