| 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/common/plugin_group.h" | 5 #include "chrome/common/plugin_group.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "base/version.h" | 10 #include "base/version.h" |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 const WebPluginInfo& web_plugin = web_plugin_infos_[i]; | 280 const WebPluginInfo& web_plugin = web_plugin_infos_[i]; |
| 281 int priority = web_plugin_positions_[i]; | 281 int priority = web_plugin_positions_[i]; |
| 282 DictionaryValue* plugin_file = new DictionaryValue(); | 282 DictionaryValue* plugin_file = new DictionaryValue(); |
| 283 plugin_file->SetString("name", web_plugin.name); | 283 plugin_file->SetString("name", web_plugin.name); |
| 284 plugin_file->SetString("description", web_plugin.desc); | 284 plugin_file->SetString("description", web_plugin.desc); |
| 285 plugin_file->SetString("path", web_plugin.path.value()); | 285 plugin_file->SetString("path", web_plugin.path.value()); |
| 286 plugin_file->SetString("version", web_plugin.version); | 286 plugin_file->SetString("version", web_plugin.version); |
| 287 bool plugin_disabled_by_policy = group_disabled_by_policy || | 287 bool plugin_disabled_by_policy = group_disabled_by_policy || |
| 288 IsPluginNameDisabledByPolicy(web_plugin.name); | 288 IsPluginNameDisabledByPolicy(web_plugin.name); |
| 289 if (plugin_disabled_by_policy) { | 289 if (plugin_disabled_by_policy) { |
| 290 result->SetString("enabledMode", "disabledByPolicy"); | 290 plugin_file->SetString("enabledMode", "disabledByPolicy"); |
| 291 } else { | 291 } else { |
| 292 result->SetString("enabledMode", | 292 plugin_file->SetString("enabledMode", |
| 293 web_plugin.enabled ? "enabled" : "disabledByUser"); | 293 web_plugin.enabled ? "enabled" : "disabledByUser"); |
| 294 } | 294 } |
| 295 plugin_file->SetInteger("priority", priority); | 295 plugin_file->SetInteger("priority", priority); |
| 296 | 296 |
| 297 ListValue* mime_types = new ListValue(); | 297 ListValue* mime_types = new ListValue(); |
| 298 for (std::vector<WebPluginMimeType>::const_iterator type_it = | 298 for (std::vector<WebPluginMimeType>::const_iterator type_it = |
| 299 web_plugin.mime_types.begin(); | 299 web_plugin.mime_types.begin(); |
| 300 type_it != web_plugin.mime_types.end(); | 300 type_it != web_plugin.mime_types.end(); |
| 301 ++type_it) { | 301 ++type_it) { |
| 302 DictionaryValue* mime_type = new DictionaryValue(); | 302 DictionaryValue* mime_type = new DictionaryValue(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 web_plugin_infos_.begin(); | 336 web_plugin_infos_.begin(); |
| 337 it != web_plugin_infos_.end(); ++it) { | 337 it != web_plugin_infos_.end(); ++it) { |
| 338 if (enable && !IsPluginNameDisabledByPolicy(it->name)) { | 338 if (enable && !IsPluginNameDisabledByPolicy(it->name)) { |
| 339 NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(it->path)); | 339 NPAPI::PluginList::Singleton()->EnablePlugin(FilePath(it->path)); |
| 340 } else { | 340 } else { |
| 341 NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(it->path)); | 341 NPAPI::PluginList::Singleton()->DisablePlugin(FilePath(it->path)); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 } | 344 } |
| 345 | 345 |
| OLD | NEW |