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

Unified Diff: chrome/browser/ui/webui/policy_ui.cc

Issue 645043003: Cleanup: Prevent usage of various extension headers when extensions support is not compiled in. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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/ui/webui/policy_ui.cc
diff --git a/chrome/browser/ui/webui/policy_ui.cc b/chrome/browser/ui/webui/policy_ui.cc
index 173ef8e57f10baa9cf0737f05a81a86493f0c160..22111af08b4e700ca337be15cd81bf55f9db72d6 100644
--- a/chrome/browser/ui/webui/policy_ui.cc
+++ b/chrome/browser/ui/webui/policy_ui.cc
@@ -276,6 +276,7 @@ class CloudPolicyCoreStatusProvider
// CloudPolicyRefreshScheduler hosted by this |core_|.
policy::CloudPolicyCore* core_;
+ private:
DISALLOW_COPY_AND_ASSIGN(CloudPolicyCoreStatusProvider);
};
@@ -398,7 +399,9 @@ class PolicyUIHandler : public content::NotificationObserver,
scoped_ptr<CloudPolicyStatusProvider> user_status_provider_;
scoped_ptr<CloudPolicyStatusProvider> device_status_provider_;
+#if defined(ENABLE_EXTENSIONS)
content::NotificationRegistrar registrar_;
+#endif
base::WeakPtrFactory<PolicyUIHandler> weak_factory_;
@@ -576,12 +579,14 @@ void PolicyUIHandler::RegisterMessages() {
GetPolicyService()->AddObserver(policy::POLICY_DOMAIN_CHROME, this);
GetPolicyService()->AddObserver(policy::POLICY_DOMAIN_EXTENSIONS, this);
+#if defined(ENABLE_EXTENSIONS)
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
content::NotificationService::AllSources());
registrar_.Add(this,
extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
content::NotificationService::AllSources());
+#endif
web_ui()->RegisterMessageCallback(
"initialized",
@@ -595,10 +600,12 @@ void PolicyUIHandler::RegisterMessages() {
void PolicyUIHandler::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
+#if defined(ENABLE_EXTENSIONS)
DCHECK(type == extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED ||
type == extensions::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED);
SendPolicyNames();
SendPolicyValues();
+#endif
}
void PolicyUIHandler::OnPolicyUpdated(const policy::PolicyNamespace& ns,

Powered by Google App Engine
This is Rietveld 408576698