Chromium Code Reviews| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 47 // Different views that can be displayed in the bubble. | 47 // Different views that can be displayed in the bubble. |
| 48 enum BubbleViewMode { | 48 enum BubbleViewMode { |
| 49 // Shows a "fast profile switcher" view. | 49 // Shows a "fast profile switcher" view. |
| 50 BUBBLE_VIEW_MODE_PROFILE_CHOOSER, | 50 BUBBLE_VIEW_MODE_PROFILE_CHOOSER, |
| 51 // Shows a list of accounts for the active user. | 51 // Shows a list of accounts for the active user. |
| 52 BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, | 52 BUBBLE_VIEW_MODE_ACCOUNT_MANAGEMENT, |
| 53 // Shows a web view for primary sign in. | 53 // Shows a web view for primary sign in. |
| 54 BUBBLE_VIEW_MODE_GAIA_SIGNIN, | 54 BUBBLE_VIEW_MODE_GAIA_SIGNIN, |
| 55 // Shows a web view for adding secondary accounts. | 55 // Shows a web view for adding secondary accounts. |
| 56 BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, | 56 BUBBLE_VIEW_MODE_GAIA_ADD_ACCOUNT, |
| 57 // Shows a web view for reauthenticating an account. | |
| 58 BUBBLE_VIEW_MODE_GAIA_REAUTH, | |
| 57 // Shows a view for confirming account removal. | 59 // Shows a view for confirming account removal. |
| 58 BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL, | 60 BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL, |
| 59 // Shows a view for ending new profile management preview. | 61 // Shows a view for ending new profile management preview. |
| 60 BUBBLE_VIEW_MODE_END_PREVIEW | 62 BUBBLE_VIEW_MODE_END_PREVIEW |
| 61 }; | 63 }; |
| 62 | 64 |
| 63 enum TutorialMode { | 65 enum TutorialMode { |
| 64 TUTORIAL_MODE_NONE, // No tutorial card shown. | 66 TUTORIAL_MODE_NONE, // No tutorial card shown. |
| 65 TUTORIAL_MODE_ENABLE_PREVIEW, // The enable-mirror-preview tutorial shown. | 67 TUTORIAL_MODE_ENABLE_PREVIEW, // The enable-mirror-preview tutorial shown. |
| 66 TUTORIAL_MODE_PREVIEW_ENABLED, // The welcome-to-mirror tutorial shown. | 68 TUTORIAL_MODE_PREVIEW_ENABLED, // The welcome-to-mirror tutorial shown. |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 87 static void clear_close_on_deactivate_for_testing() { | 89 static void clear_close_on_deactivate_for_testing() { |
| 88 close_on_deactivate_for_testing_ = false; | 90 close_on_deactivate_for_testing_ = false; |
| 89 } | 91 } |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 friend class NewAvatarMenuButtonTest; | 94 friend class NewAvatarMenuButtonTest; |
| 93 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); | 95 FRIEND_TEST_ALL_PREFIXES(NewAvatarMenuButtonTest, SignOut); |
| 94 | 96 |
| 95 typedef std::vector<size_t> Indexes; | 97 typedef std::vector<size_t> Indexes; |
| 96 typedef std::map<views::Button*, int> ButtonIndexes; | 98 typedef std::map<views::Button*, int> ButtonIndexes; |
| 97 typedef std::map<views::Button*, std::string> AccountButtonIndexes; | 99 typedef std::map<views::View*, std::string> AccountButtonIndexes; |
|
noms (inactive)
2014/05/11 19:21:25
Why View? It's still a Button* that's getting adde
Roger Tawa OOO till Jul 10th
2014/05/13 21:23:54
Done.
| |
| 98 | 100 |
| 99 ProfileChooserView(views::View* anchor_view, | 101 ProfileChooserView(views::View* anchor_view, |
| 100 views::BubbleBorder::Arrow arrow, | 102 views::BubbleBorder::Arrow arrow, |
| 101 const gfx::Rect& anchor_rect, | 103 const gfx::Rect& anchor_rect, |
| 102 Browser* browser, | 104 Browser* browser, |
| 103 BubbleViewMode view_mode); | 105 BubbleViewMode view_mode); |
| 104 virtual ~ProfileChooserView(); | 106 virtual ~ProfileChooserView(); |
| 105 | 107 |
| 106 // views::BubbleDelegateView: | 108 // views::BubbleDelegateView: |
| 107 virtual void Init() OVERRIDE; | 109 virtual void Init() OVERRIDE; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 152 views::View* CreateGuestProfileView(); | 154 views::View* CreateGuestProfileView(); |
| 153 views::View* CreateOtherProfilesView(const Indexes& avatars_to_show); | 155 views::View* CreateOtherProfilesView(const Indexes& avatars_to_show); |
| 154 views::View* CreateOptionsView(bool enable_lock); | 156 views::View* CreateOptionsView(bool enable_lock); |
| 155 | 157 |
| 156 // Account Management view for the profile |avatar_item|. | 158 // Account Management view for the profile |avatar_item|. |
| 157 views::View* CreateCurrentProfileAccountsView( | 159 views::View* CreateCurrentProfileAccountsView( |
| 158 const AvatarMenu::Item& avatar_item); | 160 const AvatarMenu::Item& avatar_item); |
| 159 void CreateAccountButton(views::GridLayout* layout, | 161 void CreateAccountButton(views::GridLayout* layout, |
| 160 const std::string& account, | 162 const std::string& account, |
| 161 bool is_primary_account, | 163 bool is_primary_account, |
| 164 bool reauth_required, | |
| 162 int width); | 165 int width); |
| 163 | 166 |
| 164 // Creates a webview showing the gaia signin page. | 167 // Creates a webview showing the gaia signin page. |
| 165 views::View* CreateGaiaSigninView(bool add_secondary_account); | 168 views::View* CreateGaiaSigninView(); |
| 166 | 169 |
| 167 // Creates a view to confirm account removal for |account_id_to_remove_|. | 170 // Creates a view to confirm account removal for |account_id_to_remove_|. |
| 168 views::View* CreateAccountRemovalView(); | 171 views::View* CreateAccountRemovalView(); |
| 169 | 172 |
| 170 // Removes the currently selected account and attempts to restart Chrome. | 173 // Removes the currently selected account and attempts to restart Chrome. |
| 171 void RemoveAccount(); | 174 void RemoveAccount(); |
| 172 | 175 |
| 173 // Creates a a tutorial card at the top prompting the user to try out the new | 176 // Creates a a tutorial card at the top prompting the user to try out the new |
| 174 // profile management UI. | 177 // profile management UI. |
| 175 views::View* CreateNewProfileManagementPreviewView(); | 178 views::View* CreateNewProfileManagementPreviewView(); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 200 views::LabelButton** button); | 203 views::LabelButton** button); |
| 201 | 204 |
| 202 views::View* CreateEndPreviewView(); | 205 views::View* CreateEndPreviewView(); |
| 203 | 206 |
| 204 scoped_ptr<AvatarMenu> avatar_menu_; | 207 scoped_ptr<AvatarMenu> avatar_menu_; |
| 205 Browser* browser_; | 208 Browser* browser_; |
| 206 | 209 |
| 207 // Other profiles used in the "fast profile switcher" view. | 210 // Other profiles used in the "fast profile switcher" view. |
| 208 ButtonIndexes open_other_profile_indexes_map_; | 211 ButtonIndexes open_other_profile_indexes_map_; |
| 209 | 212 |
| 210 // Accounts associated with the current profile. | 213 // Buttons associated with the current profile. |
| 211 AccountButtonIndexes current_profile_accounts_map_; | 214 AccountButtonIndexes delete_account_button_map_; |
| 215 AccountButtonIndexes reauth_account_button_map_; | |
| 212 | 216 |
| 213 // Links and buttons displayed in the tutorial card. | 217 // Links and buttons displayed in the tutorial card. |
| 214 views::Link* tutorial_learn_more_link_; | 218 views::Link* tutorial_learn_more_link_; |
| 215 views::LabelButton* tutorial_ok_button_; | 219 views::LabelButton* tutorial_ok_button_; |
| 216 views::LabelButton* tutorial_enable_new_profile_management_button_; | 220 views::LabelButton* tutorial_enable_new_profile_management_button_; |
| 217 views::Link* tutorial_end_preview_link_; | 221 views::Link* tutorial_end_preview_link_; |
| 218 views::LabelButton* tutorial_send_feedback_button_; | 222 views::LabelButton* tutorial_send_feedback_button_; |
| 219 | 223 |
| 220 // Links and buttons displayed in the active profile card. | 224 // Links and buttons displayed in the active profile card. |
| 221 views::Link* manage_accounts_link_; | 225 views::Link* manage_accounts_link_; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 249 // Active view mode. | 253 // Active view mode. |
| 250 BubbleViewMode view_mode_; | 254 BubbleViewMode view_mode_; |
| 251 | 255 |
| 252 // The current tutorial mode. | 256 // The current tutorial mode. |
| 253 TutorialMode tutorial_mode_; | 257 TutorialMode tutorial_mode_; |
| 254 | 258 |
| 255 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 259 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
| 256 }; | 260 }; |
| 257 | 261 |
| 258 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 262 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
| OLD | NEW |