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

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: rebase 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 88bfb624c6f3b03e1dbec7f85c5dddd9bfa670df..654822af1b4e030cf2cebcdf240c7d267264415f 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,
« no previous file with comments | « chrome/browser/sync/sessions/notification_service_sessions_router.cc ('k') | chrome/test/base/testing_profile.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698