Chromium Code Reviews| 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 #if defined(ENABLE_PLUGIN_INSTALLATION) | |
| 821 if (!plugins_resource_service_) { | |
| 822 plugins_resource_service_ = new PluginsResourceService(local_state()); | |
| 823 plugins_resource_service_->StartAfterDelay(); | |
| 824 } | |
| 825 #endif | |
| 826 #endif // defined(ENABLE_PLUGINS) | |
| 827 | |
| 819 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) | 828 if (local_state_->IsManagedPreference(prefs::kDefaultBrowserSettingEnabled)) |
| 820 ApplyDefaultBrowserPolicy(); | 829 ApplyDefaultBrowserPolicy(); |
| 821 | 830 |
| 822 // Triggers initialization of the singleton instance on UI thread. | 831 // Triggers initialization of the singleton instance on UI thread. |
| 823 PluginFinder::GetInstance()->Init(); | 832 PluginFinder::GetInstance()->Init(); |
|
stuartmorgan
2012/12/19 12:53:58
Are you sure the ordering here wasn't important?
nilesh
2012/12/19 21:07:44
Actually I am not sure. I am moving it back as it
| |
| 824 | 833 |
| 825 #if defined(ENABLE_PLUGIN_INSTALLATION) | |
| 826 if (!plugins_resource_service_) { | |
| 827 plugins_resource_service_ = new PluginsResourceService(local_state()); | |
| 828 plugins_resource_service_->StartAfterDelay(); | |
| 829 } | |
| 830 #endif | |
| 831 | |
| 832 #if !defined(OS_ANDROID) | 834 #if !defined(OS_ANDROID) |
| 833 if (browser_defaults::bookmarks_enabled && | 835 if (browser_defaults::bookmarks_enabled && |
| 834 BookmarkPromptController::IsEnabled()) | 836 BookmarkPromptController::IsEnabled()) |
| 835 bookmark_prompt_controller_.reset(new BookmarkPromptController()); | 837 bookmark_prompt_controller_.reset(new BookmarkPromptController()); |
| 836 #endif | 838 #endif |
| 837 } | 839 } |
| 838 | 840 |
| 839 void BrowserProcessImpl::CreateIconManager() { | 841 void BrowserProcessImpl::CreateIconManager() { |
| 840 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); | 842 DCHECK(!created_icon_manager_ && icon_manager_.get() == NULL); |
| 841 created_icon_manager_ = true; | 843 created_icon_manager_ = true; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 973 } | 975 } |
| 974 | 976 |
| 975 void BrowserProcessImpl::OnAutoupdateTimer() { | 977 void BrowserProcessImpl::OnAutoupdateTimer() { |
| 976 if (CanAutorestartForUpdate()) { | 978 if (CanAutorestartForUpdate()) { |
| 977 DLOG(WARNING) << "Detected update. Restarting browser."; | 979 DLOG(WARNING) << "Detected update. Restarting browser."; |
| 978 RestartBackgroundInstance(); | 980 RestartBackgroundInstance(); |
| 979 } | 981 } |
| 980 } | 982 } |
| 981 | 983 |
| 982 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 984 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
| OLD | NEW |