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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_extensions.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
Index: chrome/browser/geolocation/geolocation_permission_context_extensions.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
index d92f7ee6be4f5bbb359eeb89fdb0cee79b7cbf8d..7ae818988d37c8496bcc55767d4e5ba7384ed225 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_extensions.cc
@@ -5,8 +5,9 @@
#include "chrome/browser/geolocation/geolocation_permission_context_extensions.h"
#include "base/callback.h"
+#include "extensions/features/features.h"
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/permissions/permission_request_id.h"
#include "chrome/browser/profiles/profile.h"
#include "extensions/browser/extension_registry.h"
@@ -22,19 +23,19 @@ using extensions::ExtensionRegistry;
namespace {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
void CallbackContentSettingWrapper(
const base::Callback<void(ContentSetting)>& callback,
bool allowed) {
callback.Run(allowed ? CONTENT_SETTING_ALLOW : CONTENT_SETTING_BLOCK);
}
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
} // anonymous namespace
GeolocationPermissionContextExtensions::GeolocationPermissionContextExtensions(
Profile* profile)
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
: profile_(profile)
#endif
{
@@ -53,7 +54,7 @@ bool GeolocationPermissionContextExtensions::DecidePermission(
const base::Callback<void(ContentSetting)>& callback,
bool* permission_set,
bool* new_permission) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
GURL requesting_frame_origin = requesting_frame.GetOrigin();
extensions::WebViewPermissionHelper* web_view_permission_helper =
@@ -98,14 +99,14 @@ bool GeolocationPermissionContextExtensions::DecidePermission(
*new_permission = false;
return true;
}
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
return false;
}
bool GeolocationPermissionContextExtensions::CancelPermissionRequest(
content::WebContents* web_contents,
int bridge_id) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::WebViewPermissionHelper* web_view_permission_helper =
web_contents ?
extensions::WebViewPermissionHelper::FromWebContents(web_contents)
@@ -114,6 +115,6 @@ bool GeolocationPermissionContextExtensions::CancelPermissionRequest(
web_view_permission_helper->CancelGeolocationPermissionRequest(bridge_id);
return true;
}
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
return false;
}

Powered by Google App Engine
This is Rietveld 408576698