profile_chooser_view.h revision 1320f92c476a1ad9d19dba2a48c72b75566198e9
1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org// Copyright 2014 The Chromium Authors. All rights reserved.
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org// Use of this source code is governed by a BSD-style license that can be
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org// found in the LICENSE file.
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <map>
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <vector>
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "chrome/browser/profiles/avatar_menu.h"
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "chrome/browser/profiles/avatar_menu_observer.h"
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "chrome/browser/profiles/profile_metrics.h"
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "chrome/browser/ui/browser_window.h"
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "chrome/browser/ui/profile_chooser_constants.h"
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "google_apis/gaia/oauth2_token_service.h"
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "ui/views/bubble/bubble_delegate.h"
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "ui/views/controls/button/button.h"
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "ui/views/controls/link_listener.h"
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "ui/views/controls/styled_label_listener.h"
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "ui/views/controls/textfield/textfield_controller.h"
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass EditableProfilePhoto;
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass EditableProfileName;
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgnamespace gfx {
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass Image;
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgnamespace views {
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass GridLayout;
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass ImageButton;
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass Link;
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass LabelButton;
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass Browser;
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org// This bubble view is displayed when the user clicks on the avatar button.
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org// It displays a list of profiles and allows users to switch between profiles.
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgclass ProfileChooserView : public views::BubbleDelegateView,
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public views::ButtonListener,
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public views::LinkListener,
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public views::StyledLabelListener,
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public views::TextfieldController,
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public AvatarMenuObserver,
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           public OAuth2TokenService::Observer {
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org public:
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Shows the bubble if one is not already showing.  This allows us to easily
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // make a button toggle the bubble on and off when clicked: we unconditionally
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // call this function when the button is clicked and if the bubble isn't
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // showing it will appear while if it is showing, nothing will happen here and
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // the existing bubble will auto-close due to focus loss.
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static void ShowBubble(
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      profiles::BubbleViewMode view_mode,
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      profiles::TutorialMode tutorial_mode,
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const signin::ManageAccountsParams& manage_accounts_params,
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::View* anchor_view,
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::BubbleBorder::Arrow arrow,
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::BubbleBorder::BubbleAlignment border_alignment,
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      Browser* browser);
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static bool IsShowing();
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static void Hide();
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // We normally close the bubble any time it becomes inactive but this can lead
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // to flaky tests where unexpected UI events are triggering this behavior.
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Tests should call this with "false" for more consistent operation.
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static void clear_close_on_deactivate_for_testing() {
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    close_on_deactivate_for_testing_ = false;
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  }
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org private:
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  friend class NewAvatarMenuButtonTest;
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut);
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  typedef std::vector<size_t> Indexes;
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  typedef std::map<views::Button*, int> ButtonIndexes;
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  typedef std::map<views::Button*, std::string> AccountButtonIndexes;
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  ProfileChooserView(views::View* anchor_view,
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     views::BubbleBorder::Arrow arrow,
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     Browser* browser,
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     profiles::BubbleViewMode view_mode,
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     profiles::TutorialMode tutorial_mode,
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                     signin::GAIAServiceType service_type);
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual ~ProfileChooserView();
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // views::BubbleDelegateView:
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void Init() OVERRIDE;
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void WindowClosing() OVERRIDE;
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // views::ButtonListener:
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void ButtonPressed(views::Button* sender,
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                             const ui::Event& event) OVERRIDE;
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // views::LinkListener:
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void LinkClicked(views::Link* sender, int event_flags) OVERRIDE;
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // views::StyledLabelListener:
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void StyledLabelLinkClicked(
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const gfx::Range& range, int event_flags) OVERRIDE;
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // views::TextfieldController:
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual bool HandleKeyEvent(views::Textfield* sender,
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              const ui::KeyEvent& key_event) OVERRIDE;
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // AvatarMenuObserver:
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void OnAvatarMenuChanged(AvatarMenu* avatar_menu) OVERRIDE;
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // OAuth2TokenService::Observer overrides.
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE;
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE;
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static ProfileChooserView* profile_bubble_;
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  static bool close_on_deactivate_for_testing_;
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void ResetView();
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Shows the bubble with the |view_to_display|.
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void ShowView(profiles::BubbleViewMode view_to_display,
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                AvatarMenu* avatar_menu);
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates the profile chooser view.
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateProfileChooserView(AvatarMenu* avatar_menu);
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates the main profile card for the profile |avatar_item|. |is_guest|
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // is used to determine whether to show any Sign in/Sign out/Manage accounts
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // links.
130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateCurrentProfileView(
131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const AvatarMenu::Item& avatar_item,
132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      bool is_guest);
133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateGuestProfileView();
134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateOtherProfilesView(const Indexes& avatars_to_show);
135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateOptionsView(bool display_lock);
136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateSupervisedUserDisclaimerView();
137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Account Management view for the profile |avatar_item|.
139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateCurrentProfileAccountsView(
140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const AvatarMenu::Item& avatar_item);
141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void CreateAccountButton(views::GridLayout* layout,
142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           const std::string& account_id,
143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           bool is_primary_account,
144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           bool reauth_required,
145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           int width);
146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a webview showing the gaia signin page.
148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateGaiaSigninView();
149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a view to confirm account removal for |account_id_to_remove_|.
151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateAccountRemovalView();
152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Removes the currently selected account and attempts to restart Chrome.
154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void RemoveAccount();
155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Close the tutorial card.
157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void DismissTutorial();
158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a tutorial card to introduce an upgrade user to the new avatar
160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // menu if needed. |tutorial_shown| indicates if the tutorial has already been
161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // shown in the previous active view. |avatar_item| refers to the current
162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // profile.
163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateWelcomeUpgradeTutorialViewIfNeeded(
164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      bool tutorial_shown, const AvatarMenu::Item& avatar_item);
165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a tutorial card to have the user confirm the last Chrome signin,
167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Chrome sync will be delayed until the user either dismisses the tutorial,
168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // or configures sync through the "Settings" link.
169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateSigninConfirmationView();
170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a a tutorial card to show the errors in the last Chrome signin.
172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateSigninErrorView();
173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Creates a tutorial card. If |stack_button| is true, places the button above
175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // the link otherwise places both on the same row with the link left aligned
176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // and button right aligned. The method sets |link| to point to the newly
177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // create link, |button| to the newly created button, and |tutorial_mode_| to
178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // the given |tutorial_mode|.
179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View*  CreateTutorialView(
180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      profiles::TutorialMode tutorial_mode,
181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const base::string16& title_text,
182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const base::string16& content_text,
183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const base::string16& link_text,
184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      const base::string16& button_text,
185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      bool stack_button,
186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::Link** link,
187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::LabelButton** button,
188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      views::ImageButton** close_button);
189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Create a view that shows various options for an upgrade user who is not
191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // the same person as the currently signed in user.
192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::View* CreateSwitchUserView();
193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  bool ShouldShowGoIncognito() const;
195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Clean-up done after an action was performed in the ProfileChooser.
197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed);
198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  scoped_ptr<AvatarMenu> avatar_menu_;
200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  Browser* browser_;
201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Other profiles used in the "fast profile switcher" view.
203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  ButtonIndexes open_other_profile_indexes_map_;
204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Buttons associated with the current profile.
206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  AccountButtonIndexes delete_account_button_map_;
207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  AccountButtonIndexes reauth_account_button_map_;
208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  // Links and buttons displayed in the tutorial card.
210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::LabelButton* tutorial_sync_settings_ok_button_;
211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::Link* tutorial_sync_settings_link_;
212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::LabelButton* tutorial_see_whats_new_button_;
213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::Link* tutorial_not_you_link_;
214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::Link* tutorial_learn_more_link_;
215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  views::ImageButton* tutorial_close_button_;
216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
217  // Links and buttons displayed in the active profile card.
218  views::Link* manage_accounts_link_;
219  views::LabelButton* signin_current_profile_link_;
220  views::LabelButton* auth_error_email_button_;
221
222  // The profile name and photo in the active profile card. Owned by the
223  // views hierarchy.
224  EditableProfilePhoto* current_profile_photo_;
225  EditableProfileName* current_profile_name_;
226
227  // Action buttons.
228  views::LabelButton* users_button_;
229  views::LabelButton* go_incognito_button_;
230  views::LabelButton* lock_button_;
231  views::Link* add_account_link_;
232
233  // Buttons displayed in the gaia signin view.
234  views::ImageButton* gaia_signin_cancel_button_;
235
236  // Links and buttons displayed in the account removal view.
237  views::LabelButton* remove_account_button_;
238  views::ImageButton* account_removal_cancel_button_;
239
240  // Buttons in the switch user view.
241  views::LabelButton* add_person_button_;
242  views::LabelButton* disconnect_button_;
243  views::ImageButton* switch_user_cancel_button_;
244
245  // Records the account id to remove.
246  std::string account_id_to_remove_;
247
248  // Active view mode.
249  profiles::BubbleViewMode view_mode_;
250
251  // The current tutorial mode.
252  profiles::TutorialMode tutorial_mode_;
253
254  // The GAIA service type provided in the response header.
255  signin::GAIAServiceType gaia_service_type_;
256
257  DISALLOW_COPY_AND_ASSIGN(ProfileChooserView);
258};
259
260#endif  // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_
261