OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "chrome/browser/profiles/profile_window.h" | 5 #include "chrome/browser/profiles/profile_window.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 } else if (profile_open_action == | 215 } else if (profile_open_action == |
216 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { | 216 profiles::USER_MANAGER_SELECT_PROFILE_TASK_MANAGER) { |
217 page += profiles::kUserManagerSelectProfileTaskManager; | 217 page += profiles::kUserManagerSelectProfileTaskManager; |
218 } else if (profile_open_action == | 218 } else if (profile_open_action == |
219 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { | 219 profiles::USER_MANAGER_SELECT_PROFILE_ABOUT_CHROME) { |
220 page += profiles::kUserManagerSelectProfileAboutChrome; | 220 page += profiles::kUserManagerSelectProfileAboutChrome; |
221 } else if (profile_open_action == | 221 } else if (profile_open_action == |
222 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) { | 222 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_SETTINGS) { |
223 page += profiles::kUserManagerSelectProfileChromeSettings; | 223 page += profiles::kUserManagerSelectProfileChromeSettings; |
224 } else if (profile_open_action == | 224 } else if (profile_open_action == |
225 profiles::USER_MANAGER_SELECT_PROFILE_CHROME_MEMORY) { | |
226 page += profiles::kUserManagerSelectProfileChromeMemory; | |
227 } else if (profile_open_action == | |
228 profiles::USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER) { | 225 profiles::USER_MANAGER_SELECT_PROFILE_APP_LAUNCHER) { |
229 page += profiles::kUserManagerSelectProfileAppLauncher; | 226 page += profiles::kUserManagerSelectProfileAppLauncher; |
230 } | 227 } |
231 callback.Run(system_profile, page); | 228 callback.Run(system_profile, page); |
232 } | 229 } |
233 | 230 |
234 // Updates Chrome services that require notification when | 231 // Updates Chrome services that require notification when |
235 // the new_profile_management's status changes. | 232 // the new_profile_management's status changes. |
236 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, | 233 void UpdateServicesWithNewProfileManagementFlag(Profile* profile, |
237 bool new_flag_status) { | 234 bool new_flag_status) { |
238 AccountReconcilor* account_reconcilor = | 235 AccountReconcilor* account_reconcilor = |
239 AccountReconcilorFactory::GetForProfile(profile); | 236 AccountReconcilorFactory::GetForProfile(profile); |
240 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); | 237 account_reconcilor->OnNewProfileManagementFlagChanged(new_flag_status); |
241 } | 238 } |
242 | 239 |
243 } // namespace | 240 } // namespace |
244 | 241 |
245 namespace profiles { | 242 namespace profiles { |
246 | 243 |
247 // User Manager parameters are prefixed with hash. | 244 // User Manager parameters are prefixed with hash. |
248 const char kUserManagerDisplayTutorial[] = "#tutorial"; | 245 const char kUserManagerDisplayTutorial[] = "#tutorial"; |
249 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; | 246 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; |
250 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; | 247 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; |
251 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; | 248 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; |
252 const char kUserManagerSelectProfileChromeMemory[] = "#chrome-memory"; | |
253 const char kUserManagerSelectProfileAppLauncher[] = "#app-launcher"; | 249 const char kUserManagerSelectProfileAppLauncher[] = "#app-launcher"; |
254 | 250 |
255 base::FilePath GetPathOfProfileWithEmail(ProfileManager* profile_manager, | 251 base::FilePath GetPathOfProfileWithEmail(ProfileManager* profile_manager, |
256 const std::string& email) { | 252 const std::string& email) { |
257 base::string16 profile_email = base::UTF8ToUTF16(email); | 253 base::string16 profile_email = base::UTF8ToUTF16(email); |
258 std::vector<ProfileAttributesEntry*> entries = | 254 std::vector<ProfileAttributesEntry*> entries = |
259 profile_manager->GetProfileInfoCache().GetAllProfilesAttributes(); | 255 profile_manager->GetProfileInfoCache().GetAllProfilesAttributes(); |
260 for (ProfileAttributesEntry* entry : entries) { | 256 for (ProfileAttributesEntry* entry : entries) { |
261 if (entry->GetUserName() == profile_email) | 257 if (entry->GetUserName() == profile_email) |
262 return entry->GetPath(); | 258 return entry->GetPath(); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
536 PrefService* local_state = g_browser_process->local_state(); | 532 PrefService* local_state = g_browser_process->local_state(); |
537 const bool dismissed = local_state->GetBoolean( | 533 const bool dismissed = local_state->GetBoolean( |
538 prefs::kProfileAvatarRightClickTutorialDismissed); | 534 prefs::kProfileAvatarRightClickTutorialDismissed); |
539 | 535 |
540 // Don't show the tutorial if it's already been dismissed or if right-clicking | 536 // Don't show the tutorial if it's already been dismissed or if right-clicking |
541 // wouldn't show any targets. | 537 // wouldn't show any targets. |
542 return !dismissed && HasProfileSwitchTargets(profile); | 538 return !dismissed && HasProfileSwitchTargets(profile); |
543 } | 539 } |
544 | 540 |
545 } // namespace profiles | 541 } // namespace profiles |
OLD | NEW |