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

Unified Diff: chrome/browser/nacl_host/nacl_browser_delegate_impl.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/nacl_host/nacl_browser_delegate_impl.cc
diff --git a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
index add454fc297f09d9a33fc00d281e02c473d644ca..b971070b744bdff3700a534d9b6e18f70ff5aa3e 100644
--- a/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
+++ b/chrome/browser/nacl_host/nacl_browser_delegate_impl.cc
@@ -13,9 +13,6 @@
#include "base/strings/string_split.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/component_updater/pnacl_component_installer.h"
-#if defined(ENABLE_EXTENSIONS)
-#include "chrome/browser/extensions/extension_service.h"
-#endif
#include "chrome/browser/nacl_host/nacl_infobar_delegate.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -26,7 +23,11 @@
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pepper_permission_util.h"
#include "content/public/browser/browser_thread.h"
-#if defined(ENABLE_EXTENSIONS)
+#include "extensions/features/features.h"
+#include "url/gurl.h"
+
+#if BUILDFLAG(ENABLE_EXTENSIONS)
+#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/info_map.h"
#include "extensions/browser/process_manager.h"
@@ -34,7 +35,6 @@
#include "extensions/common/extension.h"
#include "extensions/common/url_pattern.h"
#endif
-#include "url/gurl.h"
namespace {
@@ -70,7 +70,7 @@ void OnKeepaliveOnUIThread(
if (instance_data.size() < 1)
return;
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
extensions::ProcessManager::OnKeepaliveFromPlugin(
instance_data[0].render_process_id,
instance_data[0].render_frame_id,
@@ -146,7 +146,7 @@ ppapi::host::HostFactory* NaClBrowserDelegateImpl::CreatePpapiHostFactory(
void NaClBrowserDelegateImpl::SetDebugPatterns(
const std::string& debug_patterns) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
if (debug_patterns.empty()) {
return;
}
@@ -176,12 +176,12 @@ void NaClBrowserDelegateImpl::SetDebugPatterns(
debug_patterns_.push_back(pattern);
}
}
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
bool NaClBrowserDelegateImpl::URLMatchesDebugPatterns(
const GURL& manifest_url) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
// Empty patterns are forbidden so we ignore them.
if (debug_patterns_.empty()) {
return true;
@@ -201,7 +201,7 @@ bool NaClBrowserDelegateImpl::URLMatchesDebugPatterns(
}
#else
return false;
-#endif // defined(ENABLE_EXTENSIONS)
+#endif // BUILDFLAG(ENABLE_EXTENSIONS)
}
// This function is security sensitive. Be sure to check with a security
@@ -211,7 +211,7 @@ bool NaClBrowserDelegateImpl::MapUrlToLocalFilePath(
bool use_blocking_api,
const base::FilePath& profile_directory,
base::FilePath* file_path) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
scoped_refptr<extensions::InfoMap> extension_info_map =
GetExtensionInfoMap(profile_directory);
return extension_info_map->MapUrlToLocalFilePath(
@@ -229,7 +229,7 @@ NaClBrowserDelegateImpl::GetOnKeepaliveCallback() {
bool NaClBrowserDelegateImpl::IsNonSfiModeAllowed(
const base::FilePath& profile_directory,
const GURL& manifest_url) {
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
const extensions::ExtensionSet* extension_set =
&GetExtensionInfoMap(profile_directory)->extensions();
return chrome::IsExtensionOrSharedModuleWhitelisted(
@@ -239,7 +239,7 @@ bool NaClBrowserDelegateImpl::IsNonSfiModeAllowed(
#endif
}
-#if defined(ENABLE_EXTENSIONS)
+#if BUILDFLAG(ENABLE_EXTENSIONS)
scoped_refptr<extensions::InfoMap> NaClBrowserDelegateImpl::GetExtensionInfoMap(
const base::FilePath& profile_directory) {
// Get the profile associated with the renderer.
« no previous file with comments | « chrome/browser/nacl_host/nacl_browser_delegate_impl.h ('k') | chrome/browser/net/chrome_extensions_network_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698