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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "chrome/browser/plugin_service.h" | 7 #include "chrome/browser/plugin_service.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // static | 60 // static |
61 bool PluginService::enable_chrome_plugins_ = true; | 61 bool PluginService::enable_chrome_plugins_ = true; |
62 | 62 |
63 // static | 63 // static |
64 void PluginService::InitGlobalInstance(Profile* profile) { | 64 void PluginService::InitGlobalInstance(Profile* profile) { |
65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 65 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
66 | 66 |
67 // We first group the plugins and then figure out which groups to disable. | 67 // We first group the plugins and then figure out which groups to disable. |
68 PluginUpdater::GetInstance()->DisablePluginGroupsFromPrefs(profile); | 68 PluginUpdater::GetInstance()->DisablePluginGroupsFromPrefs(profile); |
69 | 69 |
70 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
71 switches::kDisableOutdatedPlugins)) { | |
72 NPAPI::PluginList::Singleton()->DisableOutdatedPluginGroups(); | |
73 } | |
74 | |
75 // Have Chrome plugins write their data to the profile directory. | 70 // Have Chrome plugins write their data to the profile directory. |
76 GetInstance()->SetChromePluginDataDir(profile->GetPath()); | 71 GetInstance()->SetChromePluginDataDir(profile->GetPath()); |
77 } | 72 } |
78 | 73 |
79 // static | 74 // static |
80 PluginService* PluginService::GetInstance() { | 75 PluginService* PluginService::GetInstance() { |
81 return Singleton<PluginService>::get(); | 76 return Singleton<PluginService>::get(); |
82 } | 77 } |
83 | 78 |
84 // static | 79 // static |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); | 419 info.mime_types = ASCIIToWide(JoinString(plugins[i].mime_types, '|')); |
425 | 420 |
426 // These NPAPI entry points will never be called. TODO(darin): Come up | 421 // These NPAPI entry points will never be called. TODO(darin): Come up |
427 // with a cleaner way to register pepper plugins with the NPAPI PluginList, | 422 // with a cleaner way to register pepper plugins with the NPAPI PluginList, |
428 // or perhaps refactor the PluginList to be less specific to NPAPI. | 423 // or perhaps refactor the PluginList to be less specific to NPAPI. |
429 memset(&info.entry_points, 0, sizeof(info.entry_points)); | 424 memset(&info.entry_points, 0, sizeof(info.entry_points)); |
430 | 425 |
431 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); | 426 NPAPI::PluginList::Singleton()->RegisterInternalPlugin(info); |
432 } | 427 } |
433 } | 428 } |
OLD | NEW |