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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 view for confirming account removal. | 57 // Shows a view for confirming account removal. |
58 BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL | 58 BUBBLE_VIEW_MODE_ACCOUNT_REMOVAL, |
59 // Shows a view for ending new profile management preview. | |
60 BUBBLE_VIEW_MODE_END_PREVIEW | |
61 }; | |
62 | |
63 enum TutorialMode { | |
64 TUTORIAL_MODE_NONE, // No tutorial card shown. | |
65 TUTORIAL_MODE_ENABLE_PREVIEW, // The enable-mirror-preview tutorial shown. | |
66 TUTORIAL_MODE_PREVIEW_ENABLED, // The welcome-to-mirror tutorial shown. | |
67 TUTORIAL_MODE_SEND_FEEDBACK // The send-feedback tutorial shown. | |
59 }; | 68 }; |
60 | 69 |
61 // Shows the bubble if one is not already showing. This allows us to easily | 70 // Shows the bubble if one is not already showing. This allows us to easily |
62 // make a button toggle the bubble on and off when clicked: we unconditionally | 71 // make a button toggle the bubble on and off when clicked: we unconditionally |
63 // call this function when the button is clicked and if the bubble isn't | 72 // call this function when the button is clicked and if the bubble isn't |
64 // showing it will appear while if it is showing, nothing will happen here and | 73 // showing it will appear while if it is showing, nothing will happen here and |
65 // the existing bubble will auto-close due to focus loss. | 74 // the existing bubble will auto-close due to focus loss. |
66 static void ShowBubble(BubbleViewMode view_mode, | 75 static void ShowBubble(BubbleViewMode view_mode, |
67 views::View* anchor_view, | 76 views::View* anchor_view, |
68 views::BubbleBorder::Arrow arrow, | 77 views::BubbleBorder::Arrow arrow, |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
125 | 134 |
126 void ResetView(); | 135 void ResetView(); |
127 | 136 |
128 // Shows the bubble with the |view_to_display|. | 137 // Shows the bubble with the |view_to_display|. |
129 void ShowView(BubbleViewMode view_to_display, | 138 void ShowView(BubbleViewMode view_to_display, |
130 AvatarMenu* avatar_menu); | 139 AvatarMenu* avatar_menu); |
131 | 140 |
132 // Creates the profile chooser view. |tutorial_shown| indicates if the "mirror | 141 // Creates the profile chooser view. |tutorial_shown| indicates if the "mirror |
133 // enabled" tutorial was shown or not in the last active view. | 142 // enabled" tutorial was shown or not in the last active view. |
134 views::View* CreateProfileChooserView(AvatarMenu* avatar_menu, | 143 views::View* CreateProfileChooserView(AvatarMenu* avatar_menu, |
135 bool tutorial_shown); | 144 TutorialMode tutorial_mode); |
136 | 145 |
137 // Creates the main profile card for the profile |avatar_item|. |is_guest| | 146 // Creates the main profile card for the profile |avatar_item|. |is_guest| |
138 // is used to determine whether to show any Sign in/Sign out/Manage accounts | 147 // is used to determine whether to show any Sign in/Sign out/Manage accounts |
139 // links. | 148 // links. |
140 views::View* CreateCurrentProfileView( | 149 views::View* CreateCurrentProfileView( |
141 const AvatarMenu::Item& avatar_item, | 150 const AvatarMenu::Item& avatar_item, |
142 bool is_guest); | 151 bool is_guest); |
143 views::View* CreateGuestProfileView(); | 152 views::View* CreateGuestProfileView(); |
144 views::View* CreateOtherProfilesView(const Indexes& avatars_to_show); | 153 views::View* CreateOtherProfilesView(const Indexes& avatars_to_show); |
145 views::View* CreateOptionsView(bool enable_lock); | 154 views::View* CreateOptionsView(bool enable_lock); |
(...skipping 19 matching lines...) Expand all Loading... | |
165 // profile management UI. | 174 // profile management UI. |
166 views::View* CreateNewProfileManagementPreviewView(); | 175 views::View* CreateNewProfileManagementPreviewView(); |
167 | 176 |
168 // Creates a tutorial card shown when new profile management preview is | 177 // Creates a tutorial card shown when new profile management preview is |
169 // enabled. |current_avatar_item| indicates the current profile. | 178 // enabled. |current_avatar_item| indicates the current profile. |
170 // |tutorial_shown| indicates if the tutorial card is already shown in the | 179 // |tutorial_shown| indicates if the tutorial card is already shown in the |
171 // last active view. | 180 // last active view. |
172 views::View* CreatePreviewEnabledTutorialView( | 181 views::View* CreatePreviewEnabledTutorialView( |
173 const AvatarMenu::Item& current_avatar_item, bool tutorial_shown); | 182 const AvatarMenu::Item& current_avatar_item, bool tutorial_shown); |
174 | 183 |
184 // Creates a a tutorial card at the top prompting the user to send feedback | |
185 // about the new profile management preview and/or to end preview. | |
186 views::View* CreateSendPreviewFeedbackView(); | |
187 | |
175 // Creates a tutorial card with the specified |title_text|, |context_text|, | 188 // Creates a tutorial card with the specified |title_text|, |context_text|, |
176 // and a bottom row with a right-aligned link using the specified |link_text|, | 189 // and a bottom row with a right-aligned link using the specified |link_text|, |
177 // and a left aligned button using the specified |button_text|. The method | 190 // and a left aligned button using the specified |button_text|. The method |
178 // sets |link| to point to the newly created link, and |button| to the newly | 191 // sets |link| to point to the newly created link, |button| to the newly |
179 // created button. | 192 // created button, and |tutorial_mode_| to the given |tutorial_mode|. |
180 views::View* CreateTutorialView( | 193 views::View* CreateTutorialView( |
194 TutorialMode tutorial_mode, | |
181 const base::string16& title_text, | 195 const base::string16& title_text, |
182 const base::string16& content_text, | 196 const base::string16& content_text, |
183 const base::string16& link_text, | 197 const base::string16& link_text, |
184 const base::string16& button_text, | 198 const base::string16& button_text, |
185 views::Link** link, | 199 views::Link** link, |
186 views::LabelButton** button); | 200 views::LabelButton** button); |
187 | 201 |
202 views::View* CreateEndPreviewView(); | |
203 | |
188 scoped_ptr<AvatarMenu> avatar_menu_; | 204 scoped_ptr<AvatarMenu> avatar_menu_; |
189 Browser* browser_; | 205 Browser* browser_; |
190 | 206 |
191 // Other profiles used in the "fast profile switcher" view. | 207 // Other profiles used in the "fast profile switcher" view. |
192 ButtonIndexes open_other_profile_indexes_map_; | 208 ButtonIndexes open_other_profile_indexes_map_; |
193 | 209 |
194 // Accounts associated with the current profile. | 210 // Accounts associated with the current profile. |
195 AccountButtonIndexes current_profile_accounts_map_; | 211 AccountButtonIndexes current_profile_accounts_map_; |
196 | 212 |
197 // Links and buttons displayed in the tutorial card. | 213 // Links and buttons displayed in the tutorial card. |
198 views::Link* tutorial_learn_more_link_; | 214 views::Link* tutorial_learn_more_link_; |
199 views::LabelButton* tutorial_ok_button_; | 215 views::LabelButton* tutorial_ok_button_; |
200 views::LabelButton* tutorial_enable_new_profile_management_button_; | 216 views::LabelButton* tutorial_enable_new_profile_management_button_; |
217 views::Link* tutorial_end_preview_link_; | |
218 views::LabelButton* tutorial_send_feedback_button_; | |
201 | 219 |
202 // Links displayed in the active profile card. | 220 // Links and buttons displayed in the active profile card. |
203 views::Link* manage_accounts_link_; | 221 views::Link* manage_accounts_link_; |
204 views::LabelButton* signin_current_profile_link_; | 222 views::LabelButton* signin_current_profile_link_; |
223 views::ImageButton* question_mark_button_; | |
205 | 224 |
206 // The profile name and photo in the active profile card. Owned by the | 225 // The profile name and photo in the active profile card. Owned by the |
207 // views hierarchy. | 226 // views hierarchy. |
208 EditableProfilePhoto* current_profile_photo_; | 227 EditableProfilePhoto* current_profile_photo_; |
209 EditableProfileName* current_profile_name_; | 228 EditableProfileName* current_profile_name_; |
210 | 229 |
211 // Action buttons. | 230 // Action buttons. |
212 views::LabelButton* users_button_; | 231 views::LabelButton* users_button_; |
213 views::LabelButton* lock_button_; | 232 views::LabelButton* lock_button_; |
214 views::Link* add_account_link_; | 233 views::Link* add_account_link_; |
215 | 234 |
216 // Buttons displayed in the gaia signin view. | 235 // Buttons displayed in the gaia signin view. |
217 views::ImageButton* gaia_signin_cancel_button_; | 236 views::ImageButton* gaia_signin_cancel_button_; |
218 | 237 |
219 // Links and buttons displayed in the account removal view. | 238 // Links and buttons displayed in the account removal view. |
220 views::LabelButton* remove_account_and_relaunch_button_; | 239 views::LabelButton* remove_account_and_relaunch_button_; |
221 views::ImageButton* account_removal_cancel_button_; | 240 views::ImageButton* account_removal_cancel_button_; |
222 | 241 |
242 // Links and buttons displayed in the end-preview view. | |
243 views::LabelButton* end_preview_and_relaunch_button_; | |
244 views::ImageButton* end_preview_cancel_button_; | |
245 | |
223 // Records the account id to remove. | 246 // Records the account id to remove. |
224 std::string account_id_to_remove_; | 247 std::string account_id_to_remove_; |
225 | 248 |
226 // Active view mode. | 249 // Active view mode. |
227 BubbleViewMode view_mode_; | 250 BubbleViewMode view_mode_; |
228 | 251 |
229 // Whether the tutorial is currently shown. | 252 // The current tutoria mode. |
Roger Tawa OOO till Jul 10th
2014/04/29 18:09:36
Typo: tutorial
| |
230 bool tutorial_showing_; | 253 TutorialMode tutorial_mode_; |
231 | 254 |
232 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); | 255 DISALLOW_COPY_AND_ASSIGN(ProfileChooserView); |
233 }; | 256 }; |
234 | 257 |
235 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ | 258 #endif // CHROME_BROWSER_UI_VIEWS_PROFILES_PROFILE_CHOOSER_VIEW_H_ |
OLD | NEW |