Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1688)

Unified Diff: chrome/browser/pepper_flash_settings_manager.cc

Issue 10387161: Pepper Flash settings integration: add UI for "deauthorize content licenses". (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/pepper_flash_settings_manager.h ('k') | chrome/browser/plugin_data_remover_helper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/pepper_flash_settings_manager.cc
diff --git a/chrome/browser/pepper_flash_settings_manager.cc b/chrome/browser/pepper_flash_settings_manager.cc
new file mode 100644
index 0000000000000000000000000000000000000000..4a15ca9dcf932e1892f0f9ea6c6c65c9053b3671
--- /dev/null
+++ b/chrome/browser/pepper_flash_settings_manager.cc
@@ -0,0 +1,50 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/pepper_flash_settings_manager.h"
+
+#include <vector>
+
+#include "chrome/browser/plugin_prefs.h"
+#include "chrome/browser/prefs/pref_service.h"
+#include "chrome/common/pref_names.h"
+#include "content/public/browser/plugin_service.h"
+#include "googleurl/src/gurl.h"
+#include "webkit/plugins/plugin_constants.h"
+#include "webkit/plugins/webplugininfo.h"
+
+// static
+bool PepperFlashSettingsManager::IsPepperFlashInUse(
+ PluginPrefs* plugin_prefs,
+ webkit::WebPluginInfo* plugin_info) {
+ if (!plugin_prefs)
+ return false;
+
+ content::PluginService* plugin_service =
+ content::PluginService::GetInstance();
+ std::vector<webkit::WebPluginInfo> plugins;
+ plugin_service->GetPluginInfoArray(
+ GURL(), kFlashPluginSwfMimeType, false, &plugins, NULL);
+
+ for (std::vector<webkit::WebPluginInfo>::iterator iter = plugins.begin();
+ iter != plugins.end(); ++iter) {
+ if (webkit::IsPepperPlugin(*iter) && plugin_prefs->IsPluginEnabled(*iter)) {
+ if (plugin_info)
+ *plugin_info = *iter;
+ return true;
+ }
+ }
+ return false;
+}
+
+// static
+void PepperFlashSettingsManager::RegisterUserPrefs(PrefService* prefs) {
+ prefs->RegisterBooleanPref(prefs::kDeauthorizeContentLicenses,
+ false,
+ PrefService::UNSYNCABLE_PREF);
+
+ prefs->RegisterBooleanPref(prefs::kPepperFlashSettingsEnabled,
+ true,
+ PrefService::UNSYNCABLE_PREF);
+}
« no previous file with comments | « chrome/browser/pepper_flash_settings_manager.h ('k') | chrome/browser/plugin_data_remover_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698