| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/clipboard/clipboard.h" | 9 #include "app/clipboard/clipboard.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); | 650 PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); |
| 651 local_state_.reset( | 651 local_state_.reset( |
| 652 PrefService::CreatePrefService(local_state_path, NULL, NULL)); | 652 PrefService::CreatePrefService(local_state_path, NULL, NULL)); |
| 653 | 653 |
| 654 pref_change_registrar_.Init(local_state_.get()); | 654 pref_change_registrar_.Init(local_state_.get()); |
| 655 | 655 |
| 656 // Make sure the the plugin updater gets notifications of changes | 656 // Make sure the the plugin updater gets notifications of changes |
| 657 // in the plugin blacklist. | 657 // in the plugin blacklist. |
| 658 local_state_->RegisterListPref(prefs::kPluginsPluginsBlacklist); | 658 local_state_->RegisterListPref(prefs::kPluginsPluginsBlacklist); |
| 659 pref_change_registrar_.Add(prefs::kPluginsPluginsBlacklist, | 659 pref_change_registrar_.Add(prefs::kPluginsPluginsBlacklist, |
| 660 PluginUpdater::GetPluginUpdater()); | 660 PluginUpdater::GetInstance()); |
| 661 | 661 |
| 662 // Initialize and set up notifications for the printing enabled | 662 // Initialize and set up notifications for the printing enabled |
| 663 // preference. | 663 // preference. |
| 664 local_state_->RegisterBooleanPref(prefs::kPrintingEnabled, true); | 664 local_state_->RegisterBooleanPref(prefs::kPrintingEnabled, true); |
| 665 bool printing_enabled = | 665 bool printing_enabled = |
| 666 local_state_->GetBoolean(prefs::kPrintingEnabled); | 666 local_state_->GetBoolean(prefs::kPrintingEnabled); |
| 667 print_job_manager_->set_printing_enabled(printing_enabled); | 667 print_job_manager_->set_printing_enabled(printing_enabled); |
| 668 pref_change_registrar_.Add(prefs::kPrintingEnabled, | 668 pref_change_registrar_.Add(prefs::kPrintingEnabled, |
| 669 print_job_manager_.get()); | 669 print_job_manager_.get()); |
| 670 } | 670 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 | 757 |
| 758 // The BrowserProcess object must outlive the file thread so we use traits | 758 // The BrowserProcess object must outlive the file thread so we use traits |
| 759 // which don't do any management. | 759 // which don't do any management. |
| 760 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); | 760 DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl); |
| 761 | 761 |
| 762 #if defined(IPC_MESSAGE_LOG_ENABLED) | 762 #if defined(IPC_MESSAGE_LOG_ENABLED) |
| 763 | 763 |
| 764 void BrowserProcessImpl::SetIPCLoggingEnabled(bool enable) { | 764 void BrowserProcessImpl::SetIPCLoggingEnabled(bool enable) { |
| 765 // First enable myself. | 765 // First enable myself. |
| 766 if (enable) | 766 if (enable) |
| 767 IPC::Logging::current()->Enable(); | 767 IPC::Logging::GetInstance()->Enable(); |
| 768 else | 768 else |
| 769 IPC::Logging::current()->Disable(); | 769 IPC::Logging::GetInstance()->Disable(); |
| 770 | 770 |
| 771 // Now tell subprocesses. Messages to ChildProcess-derived | 771 // Now tell subprocesses. Messages to ChildProcess-derived |
| 772 // processes must be done on the IO thread. | 772 // processes must be done on the IO thread. |
| 773 io_thread()->message_loop()->PostTask | 773 io_thread()->message_loop()->PostTask |
| 774 (FROM_HERE, | 774 (FROM_HERE, |
| 775 NewRunnableMethod( | 775 NewRunnableMethod( |
| 776 this, | 776 this, |
| 777 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, | 777 &BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses, |
| 778 enable)); | 778 enable)); |
| 779 | 779 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 } | 860 } |
| 861 | 861 |
| 862 void BrowserProcessImpl::OnAutoupdateTimer() { | 862 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 863 if (CanAutorestartForUpdate()) { | 863 if (CanAutorestartForUpdate()) { |
| 864 DLOG(WARNING) << "Detected update. Restarting browser."; | 864 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 865 RestartPersistentInstance(); | 865 RestartPersistentInstance(); |
| 866 } | 866 } |
| 867 } | 867 } |
| 868 | 868 |
| 869 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 869 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |