| 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(); | |
| 185 | |
| 186 // Clean-up done after an action was performed in the ProfileChooser. | 184 // Clean-up done after an action was performed in the ProfileChooser. |
| 187 void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); | 185 void PostActionPerformed(ProfileMetrics::ProfileDesktopMenu action_performed); |
| 188 | 186 |
| 189 scoped_ptr<AvatarMenu> avatar_menu_; | 187 scoped_ptr<AvatarMenu> avatar_menu_; |
| 190 Browser* browser_; | 188 Browser* browser_; |
| 191 | 189 |
| 192 // Other profiles used in the "fast profile switcher" view. | 190 // Other profiles used in the "fast profile switcher" view. |
| 193 ButtonIndexes open_other_profile_indexes_map_; | 191 ButtonIndexes open_other_profile_indexes_map_; |
| 194 | 192 |
| 195 // Buttons associated with the current profile. | 193 // Buttons associated with the current profile. |
| 196 AccountButtonIndexes delete_account_button_map_; | 194 AccountButtonIndexes delete_account_button_map_; |
| 197 AccountButtonIndexes reauth_account_button_map_; | 195 AccountButtonIndexes reauth_account_button_map_; |
| 198 | 196 |
| 199 // Links and buttons displayed in the tutorial card. | 197 // Links and buttons displayed in the tutorial card. |
| 198 views::LabelButton* tutorial_sync_settings_ok_button_; |
| 199 views::Link* tutorial_sync_settings_link_; |
| 200 views::Link* tutorial_learn_more_link_; | 200 views::Link* tutorial_learn_more_link_; |
| 201 views::LabelButton* tutorial_ok_button_; | 201 views::LabelButton* tutorial_see_whats_new_button_; |
| 202 views::LabelButton* tutorial_enable_new_profile_management_button_; | 202 views::Link* tutorial_not_you_link_; |
| 203 views::Link* tutorial_end_preview_link_; | |
| 204 views::LabelButton* tutorial_send_feedback_button_; | |
| 205 | 203 |
| 206 // Links and buttons displayed in the active profile card. | 204 // Links and buttons displayed in the active profile card. |
| 207 views::Link* manage_accounts_link_; | 205 views::Link* manage_accounts_link_; |
| 208 views::LabelButton* signin_current_profile_link_; | 206 views::LabelButton* signin_current_profile_link_; |
| 209 views::ImageButton* question_mark_button_; | |
| 210 views::LabelButton* auth_error_email_button_; | 207 views::LabelButton* auth_error_email_button_; |
| 211 | 208 |
| 212 // The profile name and photo in the active profile card. Owned by the | 209 // The profile name and photo in the active profile card. Owned by the |
| 213 // views hierarchy. | 210 // views hierarchy. |
| 214 EditableProfilePhoto* current_profile_photo_; | 211 EditableProfilePhoto* current_profile_photo_; |
| 215 EditableProfileName* current_profile_name_; | 212 EditableProfileName* current_profile_name_; |
| 216 | 213 |
| 217 // Action buttons. | 214 // Action buttons. |
| 218 views::LabelButton* users_button_; | 215 views::LabelButton* users_button_; |
| 219 views::LabelButton* go_incognito_button_; | 216 views::LabelButton* go_incognito_button_; |
| 220 views::LabelButton* lock_button_; | 217 views::LabelButton* lock_button_; |
| 221 views::Link* add_account_link_; | 218 views::Link* add_account_link_; |
| 222 | 219 |
| 223 // Buttons displayed in the gaia signin view. | 220 // Buttons displayed in the gaia signin view. |
| 224 views::ImageButton* gaia_signin_cancel_button_; | 221 views::ImageButton* gaia_signin_cancel_button_; |
| 225 | 222 |
| 226 // Links and buttons displayed in the account removal view. | 223 // Links and buttons displayed in the account removal view. |
| 227 views::LabelButton* remove_account_button_; | 224 views::LabelButton* remove_account_button_; |
| 228 views::ImageButton* account_removal_cancel_button_; | 225 views::ImageButton* account_removal_cancel_button_; |
| 229 | 226 |
| 230 // Links and buttons displayed in the end-preview view. | |
| 231 views::LabelButton* end_preview_and_relaunch_button_; | |
| 232 views::ImageButton* end_preview_cancel_button_; | |
| 233 | |
| 234 // Records the account id to remove. | 227 // Records the account id to remove. |
| 235 std::string account_id_to_remove_; | 228 std::string account_id_to_remove_; |
| 236 | 229 |
| 237 // Active view mode. | 230 // Active view mode. |
| 238 profiles::BubbleViewMode view_mode_; | 231 profiles::BubbleViewMode view_mode_; |
| 239 | 232 |
| 240 // The current tutorial mode. | 233 // The current tutorial mode. |
| 241 profiles::TutorialMode tutorial_mode_; | 234 profiles::TutorialMode tutorial_mode_; |
| 242 | 235 |
| 243 // The GAIA service type provided in the response header. | 236 // The GAIA service type provided in the response header. |
| 244 signin::GAIAServiceType gaia_service_type_; | 237 signin::GAIAServiceType gaia_service_type_; |
| 245 | 238 |
| 246 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 239 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
| 247 }; | 240 }; |
| 248 | 241 |
| 249 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 242 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
| OLD | NEW |