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 <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
866 ApplyDefaultBrowserPolicy(); | 866 ApplyDefaultBrowserPolicy(); |
867 | 867 |
868 #if defined(ENABLE_PLUGINS) | 868 #if defined(ENABLE_PLUGINS) |
869 PluginService* plugin_service = PluginService::GetInstance(); | 869 PluginService* plugin_service = PluginService::GetInstance(); |
870 plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance()); | 870 plugin_service->SetFilter(ChromePluginServiceFilter::GetInstance()); |
871 plugin_service->StartWatchingPlugins(); | 871 plugin_service->StartWatchingPlugins(); |
872 | 872 |
873 #if defined(OS_POSIX) | 873 #if defined(OS_POSIX) |
874 // Also find plugins in a user-specific plugins dir, | 874 // Also find plugins in a user-specific plugins dir, |
875 // e.g. ~/.config/chromium/Plugins. | 875 // e.g. ~/.config/chromium/Plugins. |
876 base::FilePath user_data_dir; | 876 const CommandLine& cmd_line = *CommandLine::ForCurrentProcess(); |
877 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) | 877 if (!cmd_line.HasSwitch(switches::kDisablePluginsDiscovery)) { |
878 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); | 878 base::FilePath user_data_dir; |
| 879 if (PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) |
| 880 plugin_service->AddExtraPluginDir(user_data_dir.Append("Plugins")); |
| 881 } |
879 #endif | 882 #endif |
880 | 883 |
881 // Triggers initialization of the singleton instance on UI thread. | 884 // Triggers initialization of the singleton instance on UI thread. |
882 PluginFinder::GetInstance()->Init(); | 885 PluginFinder::GetInstance()->Init(); |
883 | 886 |
884 #if defined(ENABLE_PLUGIN_INSTALLATION) | 887 #if defined(ENABLE_PLUGIN_INSTALLATION) |
885 DCHECK(!plugins_resource_service_.get()); | 888 DCHECK(!plugins_resource_service_.get()); |
886 plugins_resource_service_ = new PluginsResourceService(local_state()); | 889 plugins_resource_service_ = new PluginsResourceService(local_state()); |
887 plugins_resource_service_->Init(); | 890 plugins_resource_service_->Init(); |
888 #endif | 891 #endif |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1037 } |
1035 | 1038 |
1036 void BrowserProcessImpl::OnAutoupdateTimer() { | 1039 void BrowserProcessImpl::OnAutoupdateTimer() { |
1037 if (CanAutorestartForUpdate()) { | 1040 if (CanAutorestartForUpdate()) { |
1038 DLOG(WARNING) << "Detected update. Restarting browser."; | 1041 DLOG(WARNING) << "Detected update. Restarting browser."; |
1039 RestartBackgroundInstance(); | 1042 RestartBackgroundInstance(); |
1040 } | 1043 } |
1041 } | 1044 } |
1042 | 1045 |
1043 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1046 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |