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

Side by Side Diff: chrome/browser/browser_process_impl.cc

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WIP, latest changes from kaiwang@ Created 8 years 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/browser_process_impl.h" 5 #include "chrome/browser/browser_process_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <vector> 10 #include <vector>
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 return watchdog_thread_.get(); 392 return watchdog_thread_.get();
393 } 393 }
394 394
395 ProfileManager* BrowserProcessImpl::profile_manager() { 395 ProfileManager* BrowserProcessImpl::profile_manager() {
396 DCHECK(CalledOnValidThread()); 396 DCHECK(CalledOnValidThread());
397 if (!created_profile_manager_) 397 if (!created_profile_manager_)
398 CreateProfileManager(); 398 CreateProfileManager();
399 return profile_manager_.get(); 399 return profile_manager_.get();
400 } 400 }
401 401
402 PrefService* BrowserProcessImpl::local_state() { 402 PrefServiceSimple* BrowserProcessImpl::local_state() {
403 DCHECK(CalledOnValidThread()); 403 DCHECK(CalledOnValidThread());
404 if (!created_local_state_) 404 if (!created_local_state_)
405 CreateLocalState(); 405 CreateLocalState();
406 return local_state_.get(); 406 return local_state_.get();
407 } 407 }
408 408
409 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() { 409 net::URLRequestContextGetter* BrowserProcessImpl::system_request_context() {
410 DCHECK(CalledOnValidThread()); 410 DCHECK(CalledOnValidThread());
411 return io_thread()->system_url_request_context_getter(); 411 return io_thread()->system_url_request_context_getter();
412 } 412 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
720 profile_manager_.reset(new ProfileManager(user_data_dir)); 720 profile_manager_.reset(new ProfileManager(user_data_dir));
721 } 721 }
722 722
723 void BrowserProcessImpl::CreateLocalState() { 723 void BrowserProcessImpl::CreateLocalState() {
724 DCHECK(!created_local_state_ && local_state_.get() == NULL); 724 DCHECK(!created_local_state_ && local_state_.get() == NULL);
725 created_local_state_ = true; 725 created_local_state_ = true;
726 726
727 FilePath local_state_path; 727 FilePath local_state_path;
728 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); 728 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path));
729 local_state_.reset( 729 local_state_.reset(
730 ChromePrefServiceBuilder().CreateChromePrefs(local_state_path, 730 ChromePrefServiceBuilder().CreateLocalState(local_state_path,
731 local_state_task_runner_, 731 local_state_task_runner_,
732 policy_service(), 732 policy_service(),
733 NULL, false)); 733 NULL, false));
734 734
735 // Initialize the prefs of the local state. 735 // Initialize the prefs of the local state.
736 chrome::RegisterLocalState(local_state_.get()); 736 chrome::RegisterLocalState(local_state_.get());
737 737
738 pref_change_registrar_.Init(local_state_.get()); 738 pref_change_registrar_.Init(local_state_.get());
739 739
740 // Initialize the notification for the default browser setting policy. 740 // Initialize the notification for the default browser setting policy.
741 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, 741 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled,
742 false); 742 false);
743 pref_change_registrar_.Add( 743 pref_change_registrar_.Add(
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 968 }
969 969
970 void BrowserProcessImpl::OnAutoupdateTimer() { 970 void BrowserProcessImpl::OnAutoupdateTimer() {
971 if (CanAutorestartForUpdate()) { 971 if (CanAutorestartForUpdate()) {
972 DLOG(WARNING) << "Detected update. Restarting browser."; 972 DLOG(WARNING) << "Detected update. Restarting browser.";
973 RestartBackgroundInstance(); 973 RestartBackgroundInstance();
974 } 974 }
975 } 975 }
976 976
977 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) 977 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698