| OLD | NEW |
| 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 "chrome/browser/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 539 | 539 |
| 540 safe_browsing::ClientSideDetectionService* | 540 safe_browsing::ClientSideDetectionService* |
| 541 BrowserProcessImpl::safe_browsing_detection_service() { | 541 BrowserProcessImpl::safe_browsing_detection_service() { |
| 542 DCHECK(CalledOnValidThread()); | 542 DCHECK(CalledOnValidThread()); |
| 543 if (!created_safe_browsing_detection_service_) { | 543 if (!created_safe_browsing_detection_service_) { |
| 544 CreateSafeBrowsingDetectionService(); | 544 CreateSafeBrowsingDetectionService(); |
| 545 } | 545 } |
| 546 return safe_browsing_detection_service_.get(); | 546 return safe_browsing_detection_service_.get(); |
| 547 } | 547 } |
| 548 | 548 |
| 549 bool BrowserProcessImpl::plugin_finder_disabled() const { |
| 550 return *plugin_finder_disabled_pref_; |
| 551 } |
| 552 |
| 549 void BrowserProcessImpl::CheckForInspectorFiles() { | 553 void BrowserProcessImpl::CheckForInspectorFiles() { |
| 550 file_thread()->message_loop()->PostTask | 554 file_thread()->message_loop()->PostTask |
| 551 (FROM_HERE, | 555 (FROM_HERE, |
| 552 NewRunnableMethod(this, &BrowserProcessImpl::DoInspectorFilesCheck)); | 556 NewRunnableMethod(this, &BrowserProcessImpl::DoInspectorFilesCheck)); |
| 553 } | 557 } |
| 554 | 558 |
| 555 void BrowserProcessImpl::Observe(NotificationType type, | 559 void BrowserProcessImpl::Observe(NotificationType type, |
| 556 const NotificationSource& source, | 560 const NotificationSource& source, |
| 557 const NotificationDetails& details) { | 561 const NotificationDetails& details) { |
| 558 if (type == NotificationType::APP_TERMINATING) { | 562 if (type == NotificationType::APP_TERMINATING) { |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 755 print_job_manager_.get()); | 759 print_job_manager_.get()); |
| 756 | 760 |
| 757 // Initialize the notification for the default browser setting policy. | 761 // Initialize the notification for the default browser setting policy. |
| 758 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, | 762 local_state_->RegisterBooleanPref(prefs::kDefaultBrowserSettingEnabled, |
| 759 false); | 763 false); |
| 760 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) { | 764 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) { |
| 761 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) | 765 if (local_state_->GetBoolean(prefs::kDefaultBrowserSettingEnabled)) |
| 762 ShellIntegration::SetAsDefaultBrowser(); | 766 ShellIntegration::SetAsDefaultBrowser(); |
| 763 } | 767 } |
| 764 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); | 768 pref_change_registrar_.Add(prefs::kDefaultBrowserSettingEnabled, this); |
| 769 |
| 770 // Initialize the preference for the plugin finder policy. |
| 771 // This preference is only needed on the IO thread so make it available there. |
| 772 local_state_->RegisterBooleanPref(prefs::kDisablePluginFinder, false); |
| 773 plugin_finder_disabled_pref_.Init(prefs::kDisablePluginFinder, |
| 774 local_state_.get(), NULL); |
| 775 plugin_finder_disabled_pref_.MoveToThread(BrowserThread::IO); |
| 765 } | 776 } |
| 766 | 777 |
| 767 void BrowserProcessImpl::CreateIconManager() { | 778 void BrowserProcessImpl::CreateIconManager() { |
| 768 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 779 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
| 769 created_icon_manager_ = true; | 780 created_icon_manager_ = true; |
| 770 icon_manager_.reset(new IconManager); | 781 icon_manager_.reset(new IconManager); |
| 771 } | 782 } |
| 772 | 783 |
| 773 void BrowserProcessImpl::CreateDevToolsManager() { | 784 void BrowserProcessImpl::CreateDevToolsManager() { |
| 774 DCHECK(devtools_manager_.get() == NULL); | 785 DCHECK(devtools_manager_.get() == NULL); |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 945 } | 956 } |
| 946 | 957 |
| 947 void BrowserProcessImpl::OnAutoupdateTimer() { | 958 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 948 if (CanAutorestartForUpdate()) { | 959 if (CanAutorestartForUpdate()) { |
| 949 DLOG(WARNING) << "Detected update. Restarting browser."; | 960 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 950 RestartPersistentInstance(); | 961 RestartPersistentInstance(); |
| 951 } | 962 } |
| 952 } | 963 } |
| 953 | 964 |
| 954 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 965 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |