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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // The NewProfileLauncher class is created when to wait for a multi-profile | 78 // The NewProfileLauncher class is created when to wait for a multi-profile |
79 // to be created asynchronously. Upon completion of profile creation, the | 79 // to be created asynchronously. Upon completion of profile creation, the |
80 // NPL takes care of launching a new browser window and signing the user | 80 // NPL takes care of launching a new browser window and signing the user |
81 // in to their Google account. | 81 // in to their Google account. |
82 class NewProfileLauncher : public ProfileManagerObserver { | 82 class NewProfileLauncher : public ProfileManagerObserver { |
83 public: | 83 public: |
84 virtual void OnProfileCreated(Profile* profile) { | 84 virtual void OnProfileCreated(Profile* profile) { |
85 Browser::NewWindowWithProfile(profile); | 85 Browser::NewWindowWithProfile(profile); |
86 ProfileSyncService* service = profile->GetProfileSyncService(); | 86 ProfileSyncService* service = profile->GetProfileSyncService(); |
87 DCHECK(service); | 87 DCHECK(service); |
88 service->ShowLoginDialog(); | 88 service->ShowLoginDialog(NULL); |
89 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_PROFILE_MENU); | 89 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_PROFILE_MENU); |
90 } | 90 } |
91 | 91 |
92 virtual bool DeleteAfterCreation() OVERRIDE { return true; } | 92 virtual bool DeleteAfterCreation() OVERRIDE { return true; } |
93 }; | 93 }; |
94 | 94 |
95 // static | 95 // static |
96 void ProfileManager::ShutdownSessionServices() { | 96 void ProfileManager::ShutdownSessionServices() { |
97 ProfileManager* pm = g_browser_process->profile_manager(); | 97 ProfileManager* pm = g_browser_process->profile_manager(); |
98 if (!pm) // Is NULL when running unit tests. | 98 if (!pm) // Is NULL when running unit tests. |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 NewProfileLauncher* launcher = new NewProfileLauncher(); | 502 NewProfileLauncher* launcher = new NewProfileLauncher(); |
503 profile_manager->CreateProfileAsync(new_path, launcher); | 503 profile_manager->CreateProfileAsync(new_path, launcher); |
504 } | 504 } |
505 | 505 |
506 // static | 506 // static |
507 void ProfileManager::RegisterPrefs(PrefService* prefs) { | 507 void ProfileManager::RegisterPrefs(PrefService* prefs) { |
508 prefs->RegisterStringPref(prefs::kProfileLastUsed, ""); | 508 prefs->RegisterStringPref(prefs::kProfileLastUsed, ""); |
509 prefs->RegisterDictionaryPref(prefs::kProfileDirectoryMap); | 509 prefs->RegisterDictionaryPref(prefs::kProfileDirectoryMap); |
510 prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); | 510 prefs->RegisterIntegerPref(prefs::kProfilesNumCreated, 1); |
511 } | 511 } |
OLD | NEW |