| 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/dom_ui/plugins_ui.h" | 5 #include "chrome/browser/dom_ui/plugins_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 localized_strings.SetString("pluginDisabled", | 76 localized_strings.SetString("pluginDisabled", |
| 77 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN)); | 77 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_PLUGIN)); |
| 78 localized_strings.SetString("pluginDisabledByPolicy", | 78 localized_strings.SetString("pluginDisabledByPolicy", |
| 79 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_BY_POLICY_PLUGIN)); | 79 l10n_util::GetStringUTF16(IDS_PLUGINS_DISABLED_BY_POLICY_PLUGIN)); |
| 80 localized_strings.SetString("pluginCannotBeEnabledDueToPolicy", | 80 localized_strings.SetString("pluginCannotBeEnabledDueToPolicy", |
| 81 l10n_util::GetStringUTF16(IDS_PLUGINS_CANNOT_ENABLE_DUE_TO_POLICY)); | 81 l10n_util::GetStringUTF16(IDS_PLUGINS_CANNOT_ENABLE_DUE_TO_POLICY)); |
| 82 localized_strings.SetString("pluginDownload", | 82 localized_strings.SetString("pluginDownload", |
| 83 l10n_util::GetStringUTF16(IDS_PLUGINS_DOWNLOAD)); | 83 l10n_util::GetStringUTF16(IDS_PLUGINS_DOWNLOAD)); |
| 84 localized_strings.SetString("pluginName", | 84 localized_strings.SetString("pluginName", |
| 85 l10n_util::GetStringUTF16(IDS_PLUGINS_NAME)); | 85 l10n_util::GetStringUTF16(IDS_PLUGINS_NAME)); |
| 86 localized_strings.SetString("pluginPriority", | |
| 87 l10n_util::GetStringUTF16(IDS_PLUGINS_PRIORITY)); | |
| 88 localized_strings.SetString("pluginVersion", | 86 localized_strings.SetString("pluginVersion", |
| 89 l10n_util::GetStringUTF16(IDS_PLUGINS_VERSION)); | 87 l10n_util::GetStringUTF16(IDS_PLUGINS_VERSION)); |
| 90 localized_strings.SetString("pluginDescription", | 88 localized_strings.SetString("pluginDescription", |
| 91 l10n_util::GetStringUTF16(IDS_PLUGINS_DESCRIPTION)); | 89 l10n_util::GetStringUTF16(IDS_PLUGINS_DESCRIPTION)); |
| 92 localized_strings.SetString("pluginPath", | 90 localized_strings.SetString("pluginPath", |
| 93 l10n_util::GetStringUTF16(IDS_PLUGINS_PATH)); | 91 l10n_util::GetStringUTF16(IDS_PLUGINS_PATH)); |
| 94 localized_strings.SetString("pluginMimeTypes", | 92 localized_strings.SetString("pluginMimeTypes", |
| 95 l10n_util::GetStringUTF16(IDS_PLUGINS_MIME_TYPES)); | 93 l10n_util::GetStringUTF16(IDS_PLUGINS_MIME_TYPES)); |
| 96 localized_strings.SetString("pluginMimeTypesMimeType", | 94 localized_strings.SetString("pluginMimeTypesMimeType", |
| 97 l10n_util::GetStringUTF16(IDS_PLUGINS_MIME_TYPES_MIME_TYPE)); | 95 l10n_util::GetStringUTF16(IDS_PLUGINS_MIME_TYPES_MIME_TYPE)); |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 plugin_updater->EnablePluginGroup(false, internalpdf); | 228 plugin_updater->EnablePluginGroup(false, internalpdf); |
| 231 } else if (group_name == internalpdf) { | 229 } else if (group_name == internalpdf) { |
| 232 plugin_updater->EnablePluginGroup(false, adobereader); | 230 plugin_updater->EnablePluginGroup(false, adobereader); |
| 233 } | 231 } |
| 234 } | 232 } |
| 235 } else { | 233 } else { |
| 236 FilePath::StringType file_path; | 234 FilePath::StringType file_path; |
| 237 if (!args->GetString(0, &file_path)) | 235 if (!args->GetString(0, &file_path)) |
| 238 return; | 236 return; |
| 239 | 237 |
| 240 plugin_updater->EnablePluginFile(enable, file_path); | 238 plugin_updater->EnablePlugin(enable, file_path); |
| 241 } | 239 } |
| 242 | 240 |
| 243 // TODO(viettrungluu): We might also want to ensure that the plugins | 241 // TODO(viettrungluu): We might also want to ensure that the plugins |
| 244 // list is always written to prefs even when the user hasn't disabled a | 242 // list is always written to prefs even when the user hasn't disabled a |
| 245 // plugin. <http://crbug.com/39101> | 243 // plugin. <http://crbug.com/39101> |
| 246 plugin_updater->UpdatePreferences(dom_ui_->GetProfile(), 0); | 244 plugin_updater->UpdatePreferences(dom_ui_->GetProfile(), 0); |
| 247 } | 245 } |
| 248 | 246 |
| 249 void PluginsDOMHandler::HandleShowTermsOfServiceMessage(const ListValue* args) { | 247 void PluginsDOMHandler::HandleShowTermsOfServiceMessage(const ListValue* args) { |
| 250 // Show it in a new browser window.... | 248 // Show it in a new browser window.... |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 329 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
| 332 FilePath internal_dir; | 330 FilePath internal_dir; |
| 333 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); | 331 PathService::Get(chrome::DIR_INTERNAL_PLUGINS, &internal_dir); |
| 334 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, | 332 prefs->RegisterFilePathPref(prefs::kPluginsLastInternalDirectory, |
| 335 internal_dir); | 333 internal_dir); |
| 336 | 334 |
| 337 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); | 335 prefs->RegisterListPref(prefs::kPluginsPluginsBlacklist); |
| 338 prefs->RegisterListPref(prefs::kPluginsPluginsList); | 336 prefs->RegisterListPref(prefs::kPluginsPluginsList); |
| 339 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); | 337 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); |
| 340 } | 338 } |
| OLD | NEW |