| 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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 local_state_->RegisterBooleanPref(prefs::kRestartSwitchMode, false); | 777 local_state_->RegisterBooleanPref(prefs::kRestartSwitchMode, false); |
| 778 #endif | 778 #endif |
| 779 } | 779 } |
| 780 | 780 |
| 781 void BrowserProcessImpl::PreCreateThreads() { | 781 void BrowserProcessImpl::PreCreateThreads() { |
| 782 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), | 782 io_thread_.reset(new IOThread(local_state(), policy_service(), net_log_.get(), |
| 783 extension_event_router_forwarder_.get())); | 783 extension_event_router_forwarder_.get())); |
| 784 } | 784 } |
| 785 | 785 |
| 786 void BrowserProcessImpl::PreMainMessageLoopRun() { | 786 void BrowserProcessImpl::PreMainMessageLoopRun() { |
| 787 #if defined(ENABLE_PLUGINS) |
| 787 PluginService* plugin_service = PluginService::GetInstance(); | 788 PluginService* plugin_service = PluginService::GetInstance(); |
| 788 plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance()); | 789 plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance()); |
| 789 plugin_service->StartWatchingPlugins(); | 790 plugin_service->StartWatchingPlugins(); |
| 790 | 791 |
| 791 // Register the internal Flash if available. | 792 // Register the internal Flash if available. |
| 792 FilePath path; | 793 FilePath path; |
| 793 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 794 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 794 switches::kDisableInternalFlash) && | 795 switches::kDisableInternalFlash) && |
| 795 PathService::Get(chrome::FILE_FLASH_PLUGIN_EXISTING, &path)) { | 796 PathService::Get(chrome::FILE_FLASH_PLUGIN_EXISTING, &path)) { |
| 796 plugin_service->AddExtraPluginPath(path); | 797 plugin_service->AddExtraPluginPath(path); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 809 | 810 |
| 810 #if defined(OS_POSIX) | 811 #if defined(OS_POSIX) |
| 811 // Also find plugins in a user-specific plugins dir, | 812 // Also find plugins in a user-specific plugins dir, |
| 812 // e.g. ~/.config/chromium/Plugins. | 813 // e.g. ~/.config/chromium/Plugins. |
| 813 FilePath user_data_dir; | 814 FilePath user_data_dir; |
| 814 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { | 815 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) { |
| 815 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); | 816 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); |
| 816 } | 817 } |
| 817 #endif | 818 #endif |
| 818 | 819 |
| 820 #endif // defined(ENABLE_PLUGINS) |
| 821 |
| 819 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) | 822 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) |
| 820 ApplyDefaultBrowserPolicy(); | 823 ApplyDefaultBrowserPolicy(); |
| 821 | 824 |
| 822 // Triggers initialization of the singleton instance on UI thread. | 825 // Triggers initialization of the singleton instance on UI thread. |
| 823 PluginFinder::GetInstance()->Init(); | 826 PluginFinder::GetInstance()->Init(); |
| 824 | 827 |
| 825 #if defined(ENABLE_PLUGIN_INSTALLATION) | 828 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 826 if (!plugins_resource_service_) { | 829 if (!plugins_resource_service_) { |
| 827 plugins_resource_service_ = new PluginsResourceService(local_state()); | 830 plugins_resource_service_ = new PluginsResourceService(local_state()); |
| 828 plugins_resource_service_->StartAfterDelay(); | 831 plugins_resource_service_->StartAfterDelay(); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 973 } | 976 } |
| 974 | 977 |
| 975 void BrowserProcessImpl::OnAutoupdateTimer() { | 978 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 976 if (CanAutorestartForUpdate()) { | 979 if (CanAutorestartForUpdate()) { |
| 977 DLOG(WARNING) << "Detected update. Restarting browser."; | 980 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 978 RestartBackgroundInstance(); | 981 RestartBackgroundInstance(); |
| 979 } | 982 } |
| 980 } | 983 } |
| 981 | 984 |
| 982 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 985 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |