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

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

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month 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/ui/webui/policy_ui_handler.h ('k') | chrome/browser/ui/webui/voice_search_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/policy_ui_handler.cc
diff --git a/chrome/browser/ui/webui/policy_ui_handler.cc b/chrome/browser/ui/webui/policy_ui_handler.cc
index a4b6eb9fa7fafcfcd0be5bf57820ff037e31b84d..e52cd30fde4be6580a6b3e4deb084fde550b82a7 100644
--- a/chrome/browser/ui/webui/policy_ui_handler.cc
+++ b/chrome/browser/ui/webui/policy_ui_handler.cc
@@ -47,6 +47,7 @@
#include "components/policy/proto/device_management_backend.pb.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
+#include "extensions/features/features.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/time_format.h"
@@ -64,7 +65,7 @@
#include "components/policy/core/common/cloud/user_cloud_policy_manager.h"
#endif
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest.h"
@@ -427,7 +428,7 @@ PolicyUIHandler::~PolicyUIHandler() {
Profile::FromWebUI(web_ui())->GetOriginalProfile())->registry();
registry->RemoveObserver(this);
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))
->RemoveObserver(this);
#endif
@@ -511,7 +512,7 @@ void PolicyUIHandler::RegisterMessages() {
GetPolicyService()->AddObserver(policy::POLICY_DOMAIN_CHROME, this);
GetPolicyService()->AddObserver(policy::POLICY_DOMAIN_EXTENSIONS, this);
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui()))
->AddObserver(this);
#endif
@@ -529,7 +530,7 @@ void PolicyUIHandler::RegisterMessages() {
base::Unretained(this)));
}
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
void PolicyUIHandler::OnExtensionLoaded(
content::BrowserContext* browser_context,
const extensions::Extension* extension) {
@@ -584,7 +585,7 @@ void PolicyUIHandler::SendPolicyNames() const {
}
names.Set("chromePolicyNames", chrome_policy_names);
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
// Add extension policy names.
base::DictionaryValue* extension_policy_names = new base::DictionaryValue;
@@ -612,7 +613,7 @@ void PolicyUIHandler::SendPolicyNames() const {
extension_policy_names->Set(extension->id(), extension_value);
}
names.Set("extensionPolicyNames", extension_policy_names);
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
web_ui()->CallJavascriptFunctionUnsafe("policy.Page.setPolicyNames", names);
}
@@ -625,7 +626,7 @@ void PolicyUIHandler::SendPolicyValues() const {
GetChromePolicyValues(chrome_policies);
all_policies.Set("chromePolicies", chrome_policies);
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
// Add extension policy values.
extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(Profile::FromWebUI(web_ui()));
« no previous file with comments | « chrome/browser/ui/webui/policy_ui_handler.h ('k') | chrome/browser/ui/webui/voice_search_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698