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

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

Issue 12225046: [cros] Set profile pref for locally managed users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 // static 474 // static
475 void ProfileManager::CreateDefaultProfileAsync(const CreateCallback& callback) { 475 void ProfileManager::CreateDefaultProfileAsync(const CreateCallback& callback) {
476 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 476 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
477 ProfileManager* profile_manager = g_browser_process->profile_manager(); 477 ProfileManager* profile_manager = g_browser_process->profile_manager();
478 478
479 base::FilePath default_profile_dir = profile_manager->user_data_dir_; 479 base::FilePath default_profile_dir = profile_manager->user_data_dir_;
480 // TODO(mirandac): current directory will not always be default in the future 480 // TODO(mirandac): current directory will not always be default in the future
481 default_profile_dir = default_profile_dir.Append( 481 default_profile_dir = default_profile_dir.Append(
482 profile_manager->GetInitialProfileDir()); 482 profile_manager->GetInitialProfileDir());
483 483
484 // Chrome OS specific note: since we pass string16() here as the icon_url,
485 // profile cache information will not get updated with the is_managed value
486 // so we're fine with passing all default values here.
487 // On Chrome OS |is_managed| preference will get initialized in
488 // Profile::CREATE_STATUS_CREATED callback.
484 profile_manager->CreateProfileAsync( 489 profile_manager->CreateProfileAsync(
485 default_profile_dir, callback, string16(), string16(), false); 490 default_profile_dir, callback, string16(), string16(), false);
486 } 491 }
487 492
488 bool ProfileManager::AddProfile(Profile* profile) { 493 bool ProfileManager::AddProfile(Profile* profile) {
489 DCHECK(profile); 494 DCHECK(profile);
490 495
491 // Make sure that we're not loading a profile with the same ID as a profile 496 // Make sure that we're not loading a profile with the same ID as a profile
492 // that's already loaded. 497 // that's already loaded.
493 if (GetProfileByPath(profile->GetPath())) { 498 if (GetProfileByPath(profile->GetPath())) {
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1106 ProfileManager::ProfileInfo::ProfileInfo( 1111 ProfileManager::ProfileInfo::ProfileInfo(
1107 Profile* profile, 1112 Profile* profile,
1108 bool created) 1113 bool created)
1109 : profile(profile), 1114 : profile(profile),
1110 created(created) { 1115 created(created) {
1111 } 1116 }
1112 1117
1113 ProfileManager::ProfileInfo::~ProfileInfo() { 1118 ProfileManager::ProfileInfo::~ProfileInfo() {
1114 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); 1119 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release());
1115 } 1120 }
OLDNEW
« chrome/browser/chromeos/login/login_utils.cc ('K') | « chrome/browser/chromeos/login/login_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698