| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 namespace profiles { | 237 namespace profiles { |
| 238 | 238 |
| 239 // User Manager parameters are prefixed with hash. | 239 // User Manager parameters are prefixed with hash. |
| 240 const char kUserManagerDisplayTutorial[] = "#tutorial"; | 240 const char kUserManagerDisplayTutorial[] = "#tutorial"; |
| 241 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; | 241 const char kUserManagerSelectProfileTaskManager[] = "#task-manager"; |
| 242 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; | 242 const char kUserManagerSelectProfileAboutChrome[] = "#about-chrome"; |
| 243 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; | 243 const char kUserManagerSelectProfileChromeSettings[] = "#chrome-settings"; |
| 244 const char kUserManagerSelectProfileChromeMemory[] = "#chrome-memory"; | 244 const char kUserManagerSelectProfileChromeMemory[] = "#chrome-memory"; |
| 245 const char kUserManagerSelectProfileAppLauncher[] = "#app-launcher"; | 245 const char kUserManagerSelectProfileAppLauncher[] = "#app-launcher"; |
| 246 | 246 |
| 247 base::FilePath GetPathOfProfileWithEmail(ProfileManager* profile_manager, |
| 248 const std::string& email) { |
| 249 base::string16 profile_email = base::UTF8ToUTF16(email); |
| 250 std::vector<ProfileAttributesEntry*> entries = |
| 251 profile_manager->GetProfileInfoCache().GetAllProfilesAttributes(); |
| 252 for (ProfileAttributesEntry* entry : entries) { |
| 253 if (entry->GetUserName() == profile_email) |
| 254 return entry->GetPath(); |
| 255 } |
| 256 return base::FilePath(); |
| 257 } |
| 258 |
| 247 void FindOrCreateNewWindowForProfile( | 259 void FindOrCreateNewWindowForProfile( |
| 248 Profile* profile, | 260 Profile* profile, |
| 249 chrome::startup::IsProcessStartup process_startup, | 261 chrome::startup::IsProcessStartup process_startup, |
| 250 chrome::startup::IsFirstRun is_first_run, | 262 chrome::startup::IsFirstRun is_first_run, |
| 251 chrome::HostDesktopType desktop_type, | 263 chrome::HostDesktopType desktop_type, |
| 252 bool always_create) { | 264 bool always_create) { |
| 253 #if defined(OS_IOS) | 265 #if defined(OS_IOS) |
| 254 NOTREACHED(); | 266 NOTREACHED(); |
| 255 #else | 267 #else |
| 256 DCHECK(profile); | 268 DCHECK(profile); |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 PrefService* local_state = g_browser_process->local_state(); | 554 PrefService* local_state = g_browser_process->local_state(); |
| 543 const bool dismissed = local_state->GetBoolean( | 555 const bool dismissed = local_state->GetBoolean( |
| 544 prefs::kProfileAvatarRightClickTutorialDismissed); | 556 prefs::kProfileAvatarRightClickTutorialDismissed); |
| 545 | 557 |
| 546 // Don't show the tutorial if it's already been dismissed or if right-clicking | 558 // Don't show the tutorial if it's already been dismissed or if right-clicking |
| 547 // wouldn't show any targets. | 559 // wouldn't show any targets. |
| 548 return !dismissed && HasProfileSwitchTargets(profile); | 560 return !dismissed && HasProfileSwitchTargets(profile); |
| 549 } | 561 } |
| 550 | 562 |
| 551 } // namespace profiles | 563 } // namespace profiles |
| OLD | NEW |