| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/webui/plugins_ui.h" | 5 #include "chrome/browser/ui/webui/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 |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/plugin_updater.h" | 16 #include "chrome/browser/plugin_updater.h" |
| 17 #include "chrome/browser/prefs/pref_member.h" | 17 #include "chrome/browser/prefs/pref_member.h" |
| 18 #include "chrome/browser/prefs/pref_service.h" | 18 #include "chrome/browser/prefs/pref_service.h" |
| 19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
| 20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 22 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 23 #include "chrome/common/chrome_content_client.h" |
| 23 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/jstemplate_builder.h" | 25 #include "chrome/common/jstemplate_builder.h" |
| 25 #include "chrome/common/pepper_plugin_registry.h" | |
| 26 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 27 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 28 #include "content/browser/browser_thread.h" | 28 #include "content/browser/browser_thread.h" |
| 29 #include "content/browser/tab_contents/tab_contents.h" | 29 #include "content/browser/tab_contents/tab_contents.h" |
| 30 #include "content/common/notification_service.h" | 30 #include "content/common/notification_service.h" |
| 31 #include "grit/browser_resources.h" | 31 #include "grit/browser_resources.h" |
| 32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| 33 #include "grit/theme_resources.h" | 33 #include "grit/theme_resources.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 if (is_group_str == "true") { | 246 if (is_group_str == "true") { |
| 247 string16 group_name; | 247 string16 group_name; |
| 248 if (!args->GetString(0, &group_name)) | 248 if (!args->GetString(0, &group_name)) |
| 249 return; | 249 return; |
| 250 | 250 |
| 251 plugin_updater->EnablePluginGroup(enable, group_name); | 251 plugin_updater->EnablePluginGroup(enable, group_name); |
| 252 if (enable) { | 252 if (enable) { |
| 253 // See http://crbug.com/50105 for background. | 253 // See http://crbug.com/50105 for background. |
| 254 string16 adobereader = ASCIIToUTF16( | 254 string16 adobereader = ASCIIToUTF16( |
| 255 webkit::npapi::PluginGroup::kAdobeReaderGroupName); | 255 webkit::npapi::PluginGroup::kAdobeReaderGroupName); |
| 256 string16 internalpdf = ASCIIToUTF16(PepperPluginRegistry::kPDFPluginName); | 256 string16 internalpdf = |
| 257 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName); |
| 257 if (group_name == adobereader) { | 258 if (group_name == adobereader) { |
| 258 plugin_updater->EnablePluginGroup(false, internalpdf); | 259 plugin_updater->EnablePluginGroup(false, internalpdf); |
| 259 } else if (group_name == internalpdf) { | 260 } else if (group_name == internalpdf) { |
| 260 plugin_updater->EnablePluginGroup(false, adobereader); | 261 plugin_updater->EnablePluginGroup(false, adobereader); |
| 261 } | 262 } |
| 262 } | 263 } |
| 263 } else { | 264 } else { |
| 264 FilePath::StringType file_path; | 265 FilePath::StringType file_path; |
| 265 if (!args->GetString(0, &file_path)) | 266 if (!args->GetString(0, &file_path)) |
| 266 return; | 267 return; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 373 internal_dir); | 374 internal_dir); |
| 374 | 375 |
| 375 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins); | 376 prefs->RegisterListPref(prefs::kPluginsDisabledPlugins); |
| 376 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions); | 377 prefs->RegisterListPref(prefs::kPluginsDisabledPluginsExceptions); |
| 377 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins); | 378 prefs->RegisterListPref(prefs::kPluginsEnabledPlugins); |
| 378 prefs->RegisterListPref(prefs::kPluginsPluginsList); | 379 prefs->RegisterListPref(prefs::kPluginsPluginsList); |
| 379 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); | 380 prefs->RegisterBooleanPref(prefs::kPluginsEnabledInternalPDF, false); |
| 380 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); | 381 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, false); |
| 381 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, true); | 382 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, true); |
| 382 } | 383 } |
| OLD | NEW |