Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4072)

Unified Diff: chrome/browser/ui/cocoa/browser/profile_chooser_controller.h

Issue 114143002: [Mac] Account management view for the new avatar bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser/profile_chooser_controller.h
diff --git a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.h b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.h
index 9b95eee8e64ac6c996fec99f96ce4f8ead745ae6..4efca94f1cd4a4f339e2dbc839ec9c7f4057ced6 100644
--- a/chrome/browser/ui/cocoa/browser/profile_chooser_controller.h
+++ b/chrome/browser/ui/cocoa/browser/profile_chooser_controller.h
@@ -6,26 +6,65 @@
#define CHROME_BROWSER_UI_COCOA_BROWSER_PROFILE_CHOOSER_CONTROLLER_H_
#import <Cocoa/Cocoa.h>
+#include <map>
#include "base/memory/scoped_ptr.h"
#import "chrome/browser/ui/cocoa/base_bubble_controller.h"
class AvatarMenu;
+class ActiveProfileObserverBridge;
class Browser;
+class ProfileOAuth2TokenService;
+
+namespace content {
+class WebContents;
+}
// This window controller manages the bubble that displays a "menu" of profiles.
// It is brought open by clicking on the avatar icon in the window frame.
@interface ProfileChooserController : BaseBubbleController {
@private
+ // Different views that can be displayed in the bubble.
+ enum BubbleViewMode {
+ PROFILE_CHOOSER_VIEW, // Shows a "fast profile switcher" view.
+ ACCOUNT_MANAGEMENT_VIEW, // Shows a list of accounts for the active user.
+ GAIA_SIGNIN_VIEW, // Shows a web view for primary sign in.
+ GAIA_ADD_ACCOUNT_VIEW // Shows a web view for adding secondary accounts.
+ };
+
// The menu that contains the data from the backend.
scoped_ptr<AvatarMenu> avatarMenu_;
+ // An observer to be notified when the OAuth2 tokens change or the avatar
+ // menu model updates for the active profile.
+ scoped_ptr<ActiveProfileObserverBridge> observer_;
+
// The browser that launched the bubble. Not owned.
Browser* browser_;
+
+ // Active view mode.
+ BubbleViewMode viewMode_;
+
+ // List of the full, un-elided accounts for the active profile. The keys are
+ // generated used to tag the UI buttons, and the values are the original
+ // emails displayed by the buttons.
+ std::map<int, std::string> currentProfileAccounts_;
+
+ // Web contents used by the inline signin view.
+ scoped_ptr<content::WebContents> webContents_;
+
+ // Whether the bubble is displayed for an active guest profile.
+ BOOL isGuestSession_;
}
- (id)initWithBrowser:(Browser*)browser anchoredAt:(NSPoint)point;
+// Creates all the subviews of the avatar bubble for |viewToDisplay|.
+- (void)initMenuContentsWithView:(BubbleViewMode)viewToDisplay;
+
+// Returns the view currently displayed by the bubble.
+- (BubbleViewMode)viewMode;
+
// Creates a new profile.
- (IBAction)addNewProfile:(id)sender;
@@ -50,6 +89,11 @@ class Browser;
// Shows the signin page.
- (IBAction)showSigninPage:(id)sender;
+// Adds an account to the active profile.
+- (IBAction)addAccount:(id)sender;
+
+// Deletes an account from the active profile.
+- (IBAction)removeAccount:(id)sender;
@end
// Testing API /////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser/profile_chooser_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698