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

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

Issue 53383002: ChromeOS: Remove ProfileHelper::IsSigninProfile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TestingProfile. Created 7 years, 1 month 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 "chrome/browser/profiles/profile_impl.h" 5 #include "chrome/browser/profiles/profile_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 Delegate* delegate, 373 Delegate* delegate,
374 CreateMode create_mode, 374 CreateMode create_mode,
375 base::SequencedTaskRunner* sequenced_task_runner) 375 base::SequencedTaskRunner* sequenced_task_runner)
376 : path_(path), 376 : path_(path),
377 pref_registry_(new user_prefs::PrefRegistrySyncable), 377 pref_registry_(new user_prefs::PrefRegistrySyncable),
378 io_data_(this), 378 io_data_(this),
379 host_content_settings_map_(NULL), 379 host_content_settings_map_(NULL),
380 last_session_exit_type_(EXIT_NORMAL), 380 last_session_exit_type_(EXIT_NORMAL),
381 start_time_(Time::Now()), 381 start_time_(Time::Now()),
382 #if defined(OS_CHROMEOS) 382 #if defined(OS_CHROMEOS)
383 is_login_profile_(false), 383 is_login_profile_(path.BaseName().value() == chrome::kInitialProfile),
384 #endif 384 #endif
385 delegate_(delegate), 385 delegate_(delegate),
386 predictor_(NULL) { 386 predictor_(NULL) {
387 TRACE_EVENT0("browser", "ProfileImpl::ctor") 387 TRACE_EVENT0("browser", "ProfileImpl::ctor")
388 DCHECK(!path.empty()) << "Using an empty path will attempt to write " << 388 DCHECK(!path.empty()) << "Using an empty path will attempt to write " <<
389 "profile files to the root directory!"; 389 "profile files to the root directory!";
390 390
391 #if defined(ENABLE_SESSION_SERVICE) 391 #if defined(ENABLE_SESSION_SERVICE)
392 create_session_service_timer_.Start(FROM_HERE, 392 create_session_service_timer_.Start(FROM_HERE,
393 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this, 393 TimeDelta::FromMilliseconds(kCreateSessionServiceDelayMS), this,
(...skipping 23 matching lines...) Expand all
417 #endif 417 #endif
418 profile_policy_connector_ = 418 profile_policy_connector_ =
419 policy::ProfilePolicyConnectorFactory::CreateForProfile( 419 policy::ProfilePolicyConnectorFactory::CreateForProfile(
420 this, force_immediate_policy_load); 420 this, force_immediate_policy_load);
421 421
422 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS || 422 DCHECK(create_mode == CREATE_MODE_ASYNCHRONOUS ||
423 create_mode == CREATE_MODE_SYNCHRONOUS); 423 create_mode == CREATE_MODE_SYNCHRONOUS);
424 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS; 424 bool async_prefs = create_mode == CREATE_MODE_ASYNCHRONOUS;
425 425
426 #if defined(OS_CHROMEOS) 426 #if defined(OS_CHROMEOS)
427 is_login_profile_ = chromeos::ProfileHelper::IsSigninProfile(this);
428 if (is_login_profile_) 427 if (is_login_profile_)
429 chrome::RegisterLoginProfilePrefs(pref_registry_.get()); 428 chrome::RegisterLoginProfilePrefs(pref_registry_.get());
430 else 429 else
431 #endif 430 #endif
432 chrome::RegisterUserProfilePrefs(pref_registry_.get()); 431 chrome::RegisterUserProfilePrefs(pref_registry_.get());
433 432
434 ManagedUserSettingsService* managed_user_settings = NULL; 433 ManagedUserSettingsService* managed_user_settings = NULL;
435 #if defined(ENABLE_MANAGED_USERS) 434 #if defined(ENABLE_MANAGED_USERS)
436 managed_user_settings = 435 managed_user_settings =
437 ManagedUserSettingsServiceFactory::GetForProfile(this); 436 ManagedUserSettingsServiceFactory::GetForProfile(this);
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
1217 DCHECK(max_size); 1216 DCHECK(max_size);
1218 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); 1217 base::FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir));
1219 if (!path.empty()) 1218 if (!path.empty())
1220 *cache_path = path; 1219 *cache_path = path;
1221 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1220 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1222 prefs_->GetInteger(prefs::kDiskCacheSize); 1221 prefs_->GetInteger(prefs::kDiskCacheSize);
1223 } 1222 }
1224 1223
1225 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() { 1224 PrefProxyConfigTracker* ProfileImpl::CreateProxyConfigTracker() {
1226 #if defined(OS_CHROMEOS) 1225 #if defined(OS_CHROMEOS)
1227 if (chromeos::ProfileHelper::IsSigninProfile(this)) { 1226 if (is_login_profile_) {
1228 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState( 1227 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfLocalState(
1229 g_browser_process->local_state()); 1228 g_browser_process->local_state());
1230 } 1229 }
1231 #endif // defined(OS_CHROMEOS) 1230 #endif // defined(OS_CHROMEOS)
1232 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile( 1231 return ProxyServiceFactory::CreatePrefProxyConfigTrackerOfProfile(
1233 GetPrefs(), g_browser_process->local_state()); 1232 GetPrefs(), g_browser_process->local_state());
1234 } 1233 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698