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_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 static ProfileChooserView* profile_bubble_; | 112 static ProfileChooserView* profile_bubble_; |
113 static bool close_on_deactivate_for_testing_; | 113 static bool close_on_deactivate_for_testing_; |
114 | 114 |
115 void ResetView(); | 115 void ResetView(); |
116 | 116 |
117 // Shows the bubble with the |view_to_display|. | 117 // Shows the bubble with the |view_to_display|. |
118 void ShowView(profiles::BubbleViewMode view_to_display, | 118 void ShowView(profiles::BubbleViewMode view_to_display, |
119 AvatarMenu* avatar_menu); | 119 AvatarMenu* avatar_menu); |
120 | 120 |
121 // Creates the profile chooser view. |tutorial_shown| indicates if the "mirror | 121 // Creates the profile chooser view. |tutorial_shown| indicates if a tutorial |
122 // enabled" tutorial was shown or not in the last active view. | 122 // was shown in the last active view. |
123 views::View* CreateProfileChooserView(AvatarMenu* avatar_menu, | 123 views::View* CreateProfileChooserView(AvatarMenu* avatar_menu, |
124 profiles::TutorialMode last_tutorial_mode); | 124 profiles::TutorialMode last_tutorial_mode); |
125 | 125 |
126 // Creates the main profile card for the profile |avatar_item|. |is_guest| | 126 // Creates the main profile card for the profile |avatar_item|. |is_guest| |
127 // is used to determine whether to show any Sign in/Sign out/Manage accounts | 127 // is used to determine whether to show any Sign in/Sign out/Manage accounts |
128 // links. | 128 // links. |
129 views::View* CreateCurrentProfileView( | 129 views::View* CreateCurrentProfileView( |
130 const AvatarMenu::Item& avatar_item, | 130 const AvatarMenu::Item& avatar_item, |
131 bool is_guest); | 131 bool is_guest); |
132 views::View* CreateGuestProfileView(); | 132 views::View* CreateGuestProfileView(); |
(...skipping 12 matching lines...) Expand all Loading... |
145 | 145 |
146 // Creates a webview showing the gaia signin page. | 146 // Creates a webview showing the gaia signin page. |
147 views::View* CreateGaiaSigninView(); | 147 views::View* CreateGaiaSigninView(); |
148 | 148 |
149 // Creates a view to confirm account removal for |account_id_to_remove_|. | 149 // Creates a view to confirm account removal for |account_id_to_remove_|. |
150 views::View* CreateAccountRemovalView(); | 150 views::View* CreateAccountRemovalView(); |
151 | 151 |
152 // Removes the currently selected account and attempts to restart Chrome. | 152 // Removes the currently selected account and attempts to restart Chrome. |
153 void RemoveAccount(); | 153 void RemoveAccount(); |
154 | 154 |
155 // Creates a a tutorial card at the top prompting the user to try out the new | 155 // Creates a tutorial card to introduce an upgrade user to the new avatar |
156 // profile management UI. | 156 // menu if needed. |tutorial_shown| indicates if the tutorial has already been |
157 views::View* CreateNewProfileManagementPreviewView(); | 157 // shown in the previous active view. |avatar_item| refers to the current |
| 158 // profile. |
| 159 views::View* CreateWelcomeUpgradeTutorialViewIfNeeded( |
| 160 bool tutorial_shown, const AvatarMenu::Item& avatar_item); |
158 | 161 |
159 // Creates a tutorial card shown when new profile management preview is | 162 // Creates a tutorial card to have the user confirm the last Chrome signin, |
160 // enabled. |current_avatar_item| indicates the current profile. | 163 // Chrome sync will be delayed until the user either dismisses the tutorial, |
161 // |tutorial_shown| indicates if the tutorial card is already shown in the | 164 // or configures sync through the "Settings" link. |
162 // last active view. | 165 views::View* CreateSigninConfirmationView(); |
163 views::View* CreatePreviewEnabledTutorialView( | |
164 const AvatarMenu::Item& current_avatar_item, bool tutorial_shown); | |
165 | 166 |
166 // Creates a a tutorial card at the top prompting the user to send feedback | 167 // Creates a a tutorial card to show the errors in the last Chrome signin. |
167 // about the new profile management preview and/or to end preview. | 168 views::View* CreateSigninErrorView(); |
168 views::View* CreateSendPreviewFeedbackView(); | |
169 | 169 |
170 // Creates a tutorial card with the specified |title_text|, |context_text|, | 170 // Creates a tutorial card with the specified |title_text|, |context_text|, |
171 // and a bottom row with a right-aligned link using the specified |link_text|, | 171 // and a bottom row with a right-aligned link using the specified |link_text|, |
172 // and a left aligned button using the specified |button_text|. The method | 172 // and a left aligned button using the specified |button_text|. The method |
173 // sets |link| to point to the newly created link, |button| to the newly | 173 // sets |link| to point to the newly created link, |button| to the newly |
174 // created button, and |tutorial_mode_| to the given |tutorial_mode|. | 174 // created button, and |tutorial_mode_| to the given |tutorial_mode|. |
175 views::View* CreateTutorialView( | 175 views::View* CreateTutorialView( |
176 profiles::TutorialMode tutorial_mode, | 176 profiles::TutorialMode tutorial_mode, |
177 const base::string16& title_text, | 177 const base::string16& title_text, |
178 const base::string16& content_text, | 178 const base::string16& content_text, |
179 const base::string16& link_text, | 179 const base::string16& link_text, |
180 const base::string16& button_text, | 180 const base::string16& button_text, |
181 views::Link** link, | 181 views::Link** link, |
182 views::LabelButton** button); | 182 views::LabelButton** button); |
183 | 183 |
184 views::View* CreateEndPreviewView(); | 184 // Create a view that shows various options for an upgrade user who is not |
| 185 // the same person as the currently signed in user |avatar_item|. |
| 186 views::View* CreateSwitchUserView(const AvatarMenu::Item& avatar_item); |
185 | 187 |
186 bool ShouldShowGoIncognito() const; | 188 bool ShouldShowGoIncognito() const; |
187 | 189 |
188 // Clean-up done after an action was performed in the ProfileChooser. | 190 // Clean-up done after an action was performed in the ProfileChooser. |
189 void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); | 191 void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); |
190 | 192 |
191 scoped_ptr<AvatarMenu> avatar_menu_; | 193 scoped_ptr<AvatarMenu> avatar_menu_; |
192 Browser* browser_; | 194 Browser* browser_; |
193 | 195 |
194 // Other profiles used in the "fast profile switcher" view. | 196 // Other profiles used in the "fast profile switcher" view. |
195 ButtonIndexes open_other_profile_indexes_map_; | 197 ButtonIndexes open_other_profile_indexes_map_; |
196 | 198 |
197 // Buttons associated with the current profile. | 199 // Buttons associated with the current profile. |
198 AccountButtonIndexes delete_account_button_map_; | 200 AccountButtonIndexes delete_account_button_map_; |
199 AccountButtonIndexes reauth_account_button_map_; | 201 AccountButtonIndexes reauth_account_button_map_; |
200 | 202 |
201 // Links and buttons displayed in the tutorial card. | 203 // Links and buttons displayed in the tutorial card. |
202 views::Link* tutorial_learn_more_link_; | 204 views::LabelButton* tutorial_sync_settings_ok_button_; |
203 views::LabelButton* tutorial_ok_button_; | 205 views::Link* tutorial_sync_settings_link_; |
204 views::LabelButton* tutorial_enable_new_profile_management_button_; | 206 views::LabelButton* tutorial_see_whats_new_button_; |
205 views::Link* tutorial_end_preview_link_; | 207 views::Link* tutorial_not_you_link_; |
206 views::LabelButton* tutorial_send_feedback_button_; | |
207 | 208 |
208 // Links and buttons displayed in the active profile card. | 209 // Links and buttons displayed in the active profile card. |
209 views::Link* manage_accounts_link_; | 210 views::Link* manage_accounts_link_; |
210 views::LabelButton* signin_current_profile_link_; | 211 views::LabelButton* signin_current_profile_link_; |
211 views::ImageButton* question_mark_button_; | |
212 views::LabelButton* auth_error_email_button_; | 212 views::LabelButton* auth_error_email_button_; |
213 | 213 |
214 // The profile name and photo in the active profile card. Owned by the | 214 // The profile name and photo in the active profile card. Owned by the |
215 // views hierarchy. | 215 // views hierarchy. |
216 EditableProfilePhoto* current_profile_photo_; | 216 EditableProfilePhoto* current_profile_photo_; |
217 EditableProfileName* current_profile_name_; | 217 EditableProfileName* current_profile_name_; |
218 | 218 |
219 // Action buttons. | 219 // Action buttons. |
220 views::LabelButton* users_button_; | 220 views::LabelButton* users_button_; |
221 views::LabelButton* go_incognito_button_; | 221 views::LabelButton* go_incognito_button_; |
222 views::LabelButton* lock_button_; | 222 views::LabelButton* lock_button_; |
223 views::Link* add_account_link_; | 223 views::Link* add_account_link_; |
224 | 224 |
225 // Buttons displayed in the gaia signin view. | 225 // Buttons displayed in the gaia signin view. |
226 views::ImageButton* gaia_signin_cancel_button_; | 226 views::ImageButton* gaia_signin_cancel_button_; |
227 | 227 |
228 // Links and buttons displayed in the account removal view. | 228 // Links and buttons displayed in the account removal view. |
229 views::LabelButton* remove_account_button_; | 229 views::LabelButton* remove_account_button_; |
230 views::ImageButton* account_removal_cancel_button_; | 230 views::ImageButton* account_removal_cancel_button_; |
231 | 231 |
232 // Links and buttons displayed in the end-preview view. | 232 // Buttons in the switch user view. |
233 views::LabelButton* end_preview_and_relaunch_button_; | 233 views::LabelButton* add_person_button_; |
234 views::ImageButton* end_preview_cancel_button_; | 234 views::LabelButton* disconnect_button_; |
| 235 views::ImageButton* switch_user_cancel_button_; |
235 | 236 |
236 // Records the account id to remove. | 237 // Records the account id to remove. |
237 std::string account_id_to_remove_; | 238 std::string account_id_to_remove_; |
238 | 239 |
239 // Active view mode. | 240 // Active view mode. |
240 profiles::BubbleViewMode view_mode_; | 241 profiles::BubbleViewMode view_mode_; |
241 | 242 |
242 // The current tutorial mode. | 243 // The current tutorial mode. |
243 profiles::TutorialMode tutorial_mode_; | 244 profiles::TutorialMode tutorial_mode_; |
244 | 245 |
245 // The GAIA service type provided in the response header. | 246 // The GAIA service type provided in the response header. |
246 signin::GAIAServiceType gaia_service_type_; | 247 signin::GAIAServiceType gaia_service_type_; |
247 | 248 |
248 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 249 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
249 }; | 250 }; |
250 | 251 |
251 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 252 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
OLD | NEW |