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 "chrome/browser/plugin_updater.h" | 5 #include "chrome/browser/plugin_updater.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 } | 81 } |
82 | 82 |
83 void EnablePluginFile(bool enable, const FilePath::StringType& path) { | 83 void EnablePluginFile(bool enable, const FilePath::StringType& path) { |
84 FilePath file_path(path); | 84 FilePath file_path(path); |
85 if (enable && !PluginGroup::IsPluginPathDisabledByPolicy(file_path)) | 85 if (enable && !PluginGroup::IsPluginPathDisabledByPolicy(file_path)) |
86 NPAPI::PluginList::Singleton()->EnablePlugin(file_path); | 86 NPAPI::PluginList::Singleton()->EnablePlugin(file_path); |
87 else | 87 else |
88 NPAPI::PluginList::Singleton()->DisablePlugin(file_path); | 88 NPAPI::PluginList::Singleton()->DisablePlugin(file_path); |
89 } | 89 } |
90 | 90 |
91 #if defined(OS_CHROMEOS) | |
92 static bool enable_internal_pdf_ = true; | 91 static bool enable_internal_pdf_ = true; |
93 #else | |
94 static bool enable_internal_pdf_ = false; | |
95 #endif | |
96 | 92 |
97 void DisablePluginGroupsFromPrefs(Profile* profile) { | 93 void DisablePluginGroupsFromPrefs(Profile* profile) { |
98 bool update_internal_dir = false; | 94 bool update_internal_dir = false; |
99 FilePath last_internal_dir = | 95 FilePath last_internal_dir = |
100 profile->GetPrefs()->GetFilePath(prefs::kPluginsLastInternalDirectory); | 96 profile->GetPrefs()->GetFilePath(prefs::kPluginsLastInternalDirectory); |
101 FilePath cur_internal_dir; | 97 FilePath cur_internal_dir; |
102 if (PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &cur_internal_dir) && | 98 if (PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &cur_internal_dir) && |
103 cur_internal_dir != last_internal_dir) { | 99 cur_internal_dir != last_internal_dir) { |
104 update_internal_dir = true; | 100 update_internal_dir = true; |
105 profile->GetPrefs()->SetFilePath( | 101 profile->GetPrefs()->SetFilePath( |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 it != plugin_groups.end(); | 233 it != plugin_groups.end(); |
238 ++it) { | 234 ++it) { |
239 // Don't save preferences for vulnerable pugins. | 235 // Don't save preferences for vulnerable pugins. |
240 if (!(*it)->IsVulnerable()) { | 236 if (!(*it)->IsVulnerable()) { |
241 plugins_list->Append((*it)->GetSummary()); | 237 plugins_list->Append((*it)->GetSummary()); |
242 } | 238 } |
243 } | 239 } |
244 } | 240 } |
245 | 241 |
246 } // namespace plugin_updater | 242 } // namespace plugin_updater |
OLD | NEW |