OLD | NEW |
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 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
673 #endif // !defined(OS_CHROMEOS) | 673 #endif // !defined(OS_CHROMEOS) |
674 | 674 |
675 #if defined(OS_ANDROID) | 675 #if defined(OS_ANDROID) |
676 registry->RegisterBooleanPref( | 676 registry->RegisterBooleanPref( |
677 prefs::kCrashReportingEnabled, false); | 677 prefs::kCrashReportingEnabled, false); |
678 #endif // defined(OS_ANDROID) | 678 #endif // defined(OS_ANDROID) |
679 } | 679 } |
680 | 680 |
681 DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { | 681 DownloadRequestLimiter* BrowserProcessImpl::download_request_limiter() { |
682 DCHECK(CalledOnValidThread()); | 682 DCHECK(CalledOnValidThread()); |
683 if (!download_request_limiter_) | 683 if (!download_request_limiter_.get()) |
684 download_request_limiter_ = new DownloadRequestLimiter(); | 684 download_request_limiter_ = new DownloadRequestLimiter(); |
685 return download_request_limiter_; | 685 return download_request_limiter_.get(); |
686 } | 686 } |
687 | 687 |
688 BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { | 688 BackgroundModeManager* BrowserProcessImpl::background_mode_manager() { |
689 DCHECK(CalledOnValidThread()); | 689 DCHECK(CalledOnValidThread()); |
690 #if defined(ENABLE_BACKGROUND) | 690 #if defined(ENABLE_BACKGROUND) |
691 if (!background_mode_manager_.get()) | 691 if (!background_mode_manager_.get()) |
692 CreateBackgroundModeManager(); | 692 CreateBackgroundModeManager(); |
693 return background_mode_manager_.get(); | 693 return background_mode_manager_.get(); |
694 #else | 694 #else |
695 NOTIMPLEMENTED(); | 695 NOTIMPLEMENTED(); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 806 |
807 void BrowserProcessImpl::CreateLocalState() { | 807 void BrowserProcessImpl::CreateLocalState() { |
808 DCHECK(!created_local_state_ && local_state_.get() == NULL); | 808 DCHECK(!created_local_state_ && local_state_.get() == NULL); |
809 created_local_state_ = true; | 809 created_local_state_ = true; |
810 | 810 |
811 base::FilePath local_state_path; | 811 base::FilePath local_state_path; |
812 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); | 812 CHECK(PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path)); |
813 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; | 813 scoped_refptr<PrefRegistrySimple> pref_registry = new PrefRegistrySimple; |
814 | 814 |
815 // Register local state preferences. | 815 // Register local state preferences. |
816 chrome::RegisterLocalState(pref_registry); | 816 chrome::RegisterLocalState(pref_registry.get()); |
817 | 817 |
818 local_state_.reset( | 818 local_state_.reset( |
819 chrome_prefs::CreateLocalState(local_state_path, | 819 chrome_prefs::CreateLocalState(local_state_path, |
820 local_state_task_runner_, | 820 local_state_task_runner_.get(), |
821 policy_service(), | 821 policy_service(), |
822 NULL, | 822 NULL, |
823 pref_registry, | 823 pref_registry, |
824 false)); | 824 false)); |
825 | 825 |
826 pref_change_registrar_.Init(local_state_.get()); | 826 pref_change_registrar_.Init(local_state_.get()); |
827 | 827 |
828 // Initialize the notification for the default browser setting policy. | 828 // Initialize the notification for the default browser setting policy. |
829 pref_change_registrar_.Add( | 829 pref_change_registrar_.Add( |
830 prefs::kDefaultBrowserSettingEnabled, | 830 prefs::kDefaultBrowserSettingEnabled, |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1046 } | 1046 } |
1047 | 1047 |
1048 void BrowserProcessImpl::OnAutoupdateTimer() { | 1048 void BrowserProcessImpl::OnAutoupdateTimer() { |
1049 if (CanAutorestartForUpdate()) { | 1049 if (CanAutorestartForUpdate()) { |
1050 DLOG(WARNING) << "Detected update. Restarting browser."; | 1050 DLOG(WARNING) << "Detected update. Restarting browser."; |
1051 RestartBackgroundInstance(); | 1051 RestartBackgroundInstance(); |
1052 } | 1052 } |
1053 } | 1053 } |
1054 | 1054 |
1055 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1055 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |