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

Unified Diff: chrome/browser/plugins/plugin_prefs.h

Issue 2369353002: Adds a pref and a policy to decide if PDFs should always be opened externally. (Closed)
Patch Set: Rebase and move the friend decl in the ifdef. Created 4 years, 3 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
Index: chrome/browser/plugins/plugin_prefs.h
diff --git a/chrome/browser/plugins/plugin_prefs.h b/chrome/browser/plugins/plugin_prefs.h
index 33fe31ae5bd1ae22256a25de6c1b3d6a97f40ded..ad1c580115b9c2c8604513c31043ea3c63c39387 100644
--- a/chrome/browser/plugins/plugin_prefs.h
+++ b/chrome/browser/plugins/plugin_prefs.h
@@ -13,6 +13,7 @@
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "chrome/browser/plugins/plugin_finder.h"
+#include "chrome/common/chrome_content_client.h"
#include "components/keyed_service/core/refcounted_keyed_service.h"
#include "components/prefs/pref_change_registrar.h"
#include "components/prefs/pref_service.h"
@@ -107,12 +108,18 @@ class PluginPrefs : public RefcountedKeyedService {
void UpdatePatternsAndNotify(std::set<base::string16>* patterns,
const std::string& pref_name);
+ // Callback for changes to the AlwaysOpenPdfExternally policy.
+ void UpdatePdfPolicy(const std::string& pref_name);
+
// Allows unit tests to directly set enforced plugin patterns.
void SetPolicyEnforcedPluginPatterns(
const std::set<base::string16>& disabled_patterns,
const std::set<base::string16>& disabled_exception_patterns,
const std::set<base::string16>& enabled_patterns);
+ // Allows unit tests to directly set the AlwaysOpenPdfExternally pref.
+ void SetAlwaysOpenPdfExternally(bool always_open_pdf_externally);
Bernhard Bauer 2016/09/29 08:44:35 If this is for tests, add ...ForTesting.
pastarmovj 2016/09/29 12:14:41 I kept it consistent with SetPolicyEnforcedPluginP
+
// Callback for after the plugin groups have been loaded.
void EnablePluginGroupInternal(
bool enabled,
@@ -147,6 +154,7 @@ class PluginPrefs : public RefcountedKeyedService {
std::set<base::string16> policy_disabled_plugin_patterns_;
std::set<base::string16> policy_disabled_plugin_exception_patterns_;
std::set<base::string16> policy_enabled_plugin_patterns_;
+ bool always_open_pdf_externally_;
// Weak pointer, owns us. Only used as a notification source.
Profile* profile_;

Powered by Google App Engine
This is Rietveld 408576698