| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 // The NewProfileLauncher class is created when to wait for a multi-profile | 45 // The NewProfileLauncher class is created when to wait for a multi-profile |
| 46 // to be created asynchronously. Upon completion of profile creation, the | 46 // to be created asynchronously. Upon completion of profile creation, the |
| 47 // NPL takes care of launching a new browser window and signing the user | 47 // NPL takes care of launching a new browser window and signing the user |
| 48 // in to their Google account. | 48 // in to their Google account. |
| 49 class NewProfileLauncher : public ProfileManagerObserver { | 49 class NewProfileLauncher : public ProfileManagerObserver { |
| 50 public: | 50 public: |
| 51 virtual void OnProfileCreated(Profile* profile) { | 51 virtual void OnProfileCreated(Profile* profile) { |
| 52 Browser::NewWindowWithProfile(profile); | 52 Browser::NewWindowWithProfile(profile); |
| 53 ProfileSyncService* service = profile->GetProfileSyncService(); | 53 ProfileSyncService* service = profile->GetProfileSyncService(); |
| 54 DCHECK(service); | 54 DCHECK(service); |
| 55 service->ShowLoginDialog(NULL); | 55 service->ShowLoginDialog(); |
| 56 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_PROFILE_MENU); | 56 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_PROFILE_MENU); |
| 57 } | 57 } |
| 58 | 58 |
| 59 virtual bool DeleteAfterCreation() OVERRIDE { return true; } | 59 virtual bool DeleteAfterCreation() OVERRIDE { return true; } |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 // static | 62 // static |
| 63 void ProfileManager::ShutdownSessionServices() { | 63 void ProfileManager::ShutdownSessionServices() { |
| 64 ProfileManager* pm = g_browser_process->profile_manager(); | 64 ProfileManager* pm = g_browser_process->profile_manager(); |
| 65 if (!pm) // Is NULL when running unit tests. | 65 if (!pm) // Is NULL when running unit tests. |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 NewProfileLauncher* launcher = new NewProfileLauncher(); | 422 NewProfileLauncher* launcher = new NewProfileLauncher(); |
| 423 profile_manager->CreateProfileAsync(new_path, launcher); | 423 profile_manager->CreateProfileAsync(new_path, launcher); |
| 424 } | 424 } |
| 425 | 425 |
| 426 // static | 426 // static |
| 427 void ProfileManager::RegisterPrefs(PrefService* prefs) { | 427 void ProfileManager::RegisterPrefs(PrefService* prefs) { |
| 428 prefs->RegisterStringPref(prefs::kProfileLastUsed, ""); | 428 prefs->RegisterStringPref(prefs::kProfileLastUsed, ""); |
| 429 prefs->RegisterDictionaryPref(prefs::kProfileDirectoryMap); | 429 prefs->RegisterDictionaryPref(prefs::kProfileDirectoryMap); |
| 430 prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); | 430 prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); |
| 431 } | 431 } |
| OLD | NEW |