diff options
author | Iain Merrick <husky@google.com> | 2010-11-01 12:19:54 +0000 |
---|---|---|
committer | Iain Merrick <husky@google.com> | 2010-11-03 10:21:10 +0000 |
commit | 731df977c0511bca2206b5f333555b1205ff1f43 (patch) | |
tree | 0e750b949b3f00a1ac11fda25d3c2de512f2b465 /chrome/browser/browser_process_impl.cc | |
parent | 5add15e10e7bb80512f2c597ca57221314abe577 (diff) | |
download | external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.zip external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.gz external_chromium-731df977c0511bca2206b5f333555b1205ff1f43.tar.bz2 |
Merge Chromium at r63472 : Initial merge by git.
Change-Id: Ifb9ee821af006a5f2211e81471be93ae440a1f5a
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 88b41a9..b991455 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -20,8 +20,8 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_main.h" #include "chrome/browser/browser_process_sub_thread.h" +#include "chrome/browser/browser_thread.h" #include "chrome/browser/browser_trial.h" -#include "chrome/browser/chrome_thread.h" #include "chrome/browser/debugger/debugger_wrapper.h" #include "chrome/browser/debugger/devtools_manager.h" #include "chrome/browser/download/download_file_manager.h" @@ -283,12 +283,12 @@ void BrowserProcessImpl::EndSession() { #if defined(USE_X11) // Can't run a local loop on linux. Instead create a waitable event. base::WaitableEvent done_writing(false, false); - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableFunction(Signal, &done_writing)); done_writing.TimedWait( base::TimeDelta::FromSeconds(kEndSessionTimeoutSeconds)); #elif defined(OS_WIN) - ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE, + BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, NewRunnableFunction(PostQuit, MessageLoop::current())); MessageLoop::current()->Run(); #else @@ -549,7 +549,7 @@ void BrowserProcessImpl::CreateIOThread() { // The lifetime of the BACKGROUND_X11 thread is a subset of the IO thread so // we start it now. scoped_ptr<base::Thread> background_x11_thread( - new BrowserProcessSubThread(ChromeThread::BACKGROUND_X11)); + new BrowserProcessSubThread(BrowserThread::BACKGROUND_X11)); if (!background_x11_thread->Start()) return; background_x11_thread_.swap(background_x11_thread); @@ -568,7 +568,7 @@ void BrowserProcessImpl::CreateFileThread() { created_file_thread_ = true; scoped_ptr<base::Thread> thread( - new BrowserProcessSubThread(ChromeThread::FILE)); + new BrowserProcessSubThread(BrowserThread::FILE)); base::Thread::Options options; #if defined(OS_WIN) // On Windows, the FILE thread needs to be have a UI message loop which pumps @@ -593,7 +593,7 @@ void BrowserProcessImpl::CreateDBThread() { created_db_thread_ = true; scoped_ptr<base::Thread> thread( - new BrowserProcessSubThread(ChromeThread::DB)); + new BrowserProcessSubThread(BrowserThread::DB)); if (!thread->Start()) return; db_thread_.swap(thread); @@ -604,7 +604,7 @@ void BrowserProcessImpl::CreateProcessLauncherThread() { created_process_launcher_thread_ = true; scoped_ptr<base::Thread> thread( - new BrowserProcessSubThread(ChromeThread::PROCESS_LAUNCHER)); + new BrowserProcessSubThread(BrowserThread::PROCESS_LAUNCHER)); if (!thread->Start()) return; process_launcher_thread_.swap(thread); @@ -615,7 +615,7 @@ void BrowserProcessImpl::CreateCacheThread() { created_cache_thread_ = true; scoped_ptr<base::Thread> thread( - new BrowserProcessSubThread(ChromeThread::CACHE)); + new BrowserProcessSubThread(BrowserThread::CACHE)); base::Thread::Options options; options.message_loop_type = MessageLoop::TYPE_IO; if (!thread->StartWithOptions(options)) @@ -638,12 +638,22 @@ void BrowserProcessImpl::CreateLocalState() { PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); local_state_.reset(PrefService::CreatePrefService(local_state_path, NULL)); + pref_change_registrar_.Init(local_state_.get()); + // Make sure the the plugin updater gets notifications of changes // in the plugin blacklist. local_state_->RegisterListPref(prefs::kPluginsPluginsBlacklist); - plugin_state_change_registrar_.Init(local_state_.get()); - plugin_state_change_registrar_.Add(prefs::kPluginsPluginsBlacklist, - PluginUpdater::GetPluginUpdater()); + pref_change_registrar_.Add(prefs::kPluginsPluginsBlacklist, + PluginUpdater::GetPluginUpdater()); + + // Initialize and set up notifications for the printing enabled + // preference. + local_state_->RegisterBooleanPref(prefs::kPrintingEnabled, true); + bool printing_enabled = + local_state_->GetBoolean(prefs::kPrintingEnabled); + print_job_manager_->set_printing_enabled(printing_enabled); + pref_change_registrar_.Add(prefs::kPrintingEnabled, + print_job_manager_.get()); } void BrowserProcessImpl::CreateIconManager() { @@ -726,7 +736,7 @@ void BrowserProcessImpl::SetIPCLoggingEnabled(bool enable) { // Helper for SetIPCLoggingEnabled. void BrowserProcessImpl::SetIPCLoggingEnabledForChildProcesses(bool enabled) { - DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserChildProcessHost::Iterator i; // default constr references a singleton while (!i.Done()) { |