Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 7093004: Sync: Refactor the ProfileSyncService and sync setup flow to remove use of WebUI from PSS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fixes and cleanups. Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/options/options_page.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/options/options_page.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698