| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "content/public/browser/notification_source.h" | 37 #include "content/public/browser/notification_source.h" |
| 38 #include "content/public/browser/plugin_service.h" | 38 #include "content/public/browser/plugin_service.h" |
| 39 #include "content/public/browser/web_contents.h" | 39 #include "content/public/browser/web_contents.h" |
| 40 #include "content/public/browser/web_ui.h" | 40 #include "content/public/browser/web_ui.h" |
| 41 #include "content/public/browser/web_ui_message_handler.h" | 41 #include "content/public/browser/web_ui_message_handler.h" |
| 42 #include "grit/browser_resources.h" | 42 #include "grit/browser_resources.h" |
| 43 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
| 44 #include "grit/theme_resources.h" | 44 #include "grit/theme_resources.h" |
| 45 #include "ui/base/l10n/l10n_util.h" | 45 #include "ui/base/l10n/l10n_util.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "webkit/plugins/npapi/plugin_group.h" | |
| 48 | 47 |
| 49 #if defined(OS_CHROMEOS) | 48 #if defined(OS_CHROMEOS) |
| 50 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" | 49 #include "chrome/browser/ui/webui/chromeos/ui_account_tweaks.h" |
| 51 #endif | 50 #endif |
| 52 | 51 |
| 53 using content::PluginService; | 52 using content::PluginService; |
| 54 using content::WebContents; | 53 using content::WebContents; |
| 55 using content::WebUIMessageHandler; | 54 using content::WebUIMessageHandler; |
| 56 using webkit::npapi::PluginGroup; | |
| 57 using webkit::WebPluginInfo; | 55 using webkit::WebPluginInfo; |
| 58 | 56 |
| 59 namespace { | 57 namespace { |
| 60 | 58 |
| 61 // Callback function to process result of EnablePlugin method. | 59 // Callback function to process result of EnablePlugin method. |
| 62 void AssertPluginEnabled(bool did_enable) { | 60 void AssertPluginEnabled(bool did_enable) { |
| 63 DCHECK(did_enable); | 61 DCHECK(did_enable); |
| 64 } | 62 } |
| 65 | 63 |
| 66 ChromeWebUIDataSource* CreatePluginsUIHTMLSource() { | 64 ChromeWebUIDataSource* CreatePluginsUIHTMLSource() { |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 string16 group_name; | 240 string16 group_name; |
| 243 if (!args->GetString(0, &group_name)) { | 241 if (!args->GetString(0, &group_name)) { |
| 244 NOTREACHED(); | 242 NOTREACHED(); |
| 245 return; | 243 return; |
| 246 } | 244 } |
| 247 | 245 |
| 248 plugin_prefs->EnablePluginGroup(enable, group_name); | 246 plugin_prefs->EnablePluginGroup(enable, group_name); |
| 249 if (enable) { | 247 if (enable) { |
| 250 // See http://crbug.com/50105 for background. | 248 // See http://crbug.com/50105 for background. |
| 251 string16 adobereader = ASCIIToUTF16( | 249 string16 adobereader = ASCIIToUTF16( |
| 252 PluginGroup::kAdobeReaderGroupName); | 250 PluginMetadata::kAdobeReaderGroupName); |
| 253 string16 internalpdf = | 251 string16 internalpdf = |
| 254 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName); | 252 ASCIIToUTF16(chrome::ChromeContentClient::kPDFPluginName); |
| 255 if (group_name == adobereader) | 253 if (group_name == adobereader) |
| 256 plugin_prefs->EnablePluginGroup(false, internalpdf); | 254 plugin_prefs->EnablePluginGroup(false, internalpdf); |
| 257 else if (group_name == internalpdf) | 255 else if (group_name == internalpdf) |
| 258 plugin_prefs->EnablePluginGroup(false, adobereader); | 256 plugin_prefs->EnablePluginGroup(false, adobereader); |
| 259 } | 257 } |
| 260 } else { | 258 } else { |
| 261 FilePath::StringType file_path; | 259 FilePath::StringType file_path; |
| 262 if (!args->GetString(0, &file_path)) { | 260 if (!args->GetString(0, &file_path)) { |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 491 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { | 489 void PluginsUI::RegisterUserPrefs(PrefService* prefs) { |
| 492 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, | 490 prefs->RegisterBooleanPref(prefs::kPluginsShowDetails, |
| 493 false, | 491 false, |
| 494 PrefService::UNSYNCABLE_PREF); | 492 PrefService::UNSYNCABLE_PREF); |
| 495 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, | 493 prefs->RegisterBooleanPref(prefs::kPluginsShowSetReaderDefaultInfobar, |
| 496 true, | 494 true, |
| 497 PrefService::UNSYNCABLE_PREF); | 495 PrefService::UNSYNCABLE_PREF); |
| 498 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, | 496 prefs->RegisterDictionaryPref(prefs::kContentSettingsPluginWhitelist, |
| 499 PrefService::SYNCABLE_PREF); | 497 PrefService::SYNCABLE_PREF); |
| 500 } | 498 } |
| OLD | NEW |