Commit ddef62e7 authored by thestig@chromium.org's avatar thestig@chromium.org

ifdef various extensions code to be used only when extensions are enabled.

BUG=349436

Review URL: https://codereview.chromium.org/383903003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@282806 0039d316-1c4b-4281-b951-d872f2087c98
parent 7a4fa927
...@@ -12,8 +12,11 @@ ...@@ -12,8 +12,11 @@
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h" #include "chrome/browser/search_engines/template_url_service_factory.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/keyed_service/content/browser_context_dependency_manager.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_system_provider.h" #include "extensions/browser/extension_system_provider.h"
#include "extensions/browser/extensions_browser_client.h" #include "extensions/browser/extensions_browser_client.h"
#endif
// static // static
AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile( AutocompleteClassifier* AutocompleteClassifierFactory::GetForProfile(
...@@ -43,8 +46,10 @@ AutocompleteClassifierFactory::AutocompleteClassifierFactory() ...@@ -43,8 +46,10 @@ AutocompleteClassifierFactory::AutocompleteClassifierFactory()
: BrowserContextKeyedServiceFactory( : BrowserContextKeyedServiceFactory(
"AutocompleteClassifier", "AutocompleteClassifier",
BrowserContextDependencyManager::GetInstance()) { BrowserContextDependencyManager::GetInstance()) {
#if defined(ENABLE_EXTENSIONS)
DependsOn( DependsOn(
extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
#endif
DependsOn(TemplateURLServiceFactory::GetInstance()); DependsOn(TemplateURLServiceFactory::GetInstance());
// TODO(pkasting): Uncomment these once they exist. // TODO(pkasting): Uncomment these once they exist.
// DependsOn(PrefServiceFactory::GetInstance()); // DependsOn(PrefServiceFactory::GetInstance());
......
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include "chrome/browser/status_icons/status_icon.h" #include "chrome/browser/status_icons/status_icon.h"
#include "chrome/browser/status_icons/status_tray.h" #include "chrome/browser/status_icons/status_tray.h"
#include "chrome/browser/tab_contents/tab_util.h" #include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h" #include "content/public/browser/content_browser_client.h"
...@@ -24,8 +23,6 @@ ...@@ -24,8 +23,6 @@
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_delegate.h" #include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_observer.h" #include "content/public/browser/web_contents_observer.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
#include "grit/chromium_strings.h" #include "grit/chromium_strings.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
...@@ -34,11 +31,18 @@ ...@@ -34,11 +31,18 @@
#include "ui/base/resource/resource_bundle.h" #include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image_skia.h" #include "ui/gfx/image/image_skia.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/common/extensions/extension_constants.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension.h"
#endif
using content::BrowserThread; using content::BrowserThread;
using content::WebContents; using content::WebContents;
namespace { namespace {
#if defined(ENABLE_EXTENSIONS)
const extensions::Extension* GetExtension(WebContents* web_contents) { const extensions::Extension* GetExtension(WebContents* web_contents) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
...@@ -51,8 +55,6 @@ const extensions::Extension* GetExtension(WebContents* web_contents) { ...@@ -51,8 +55,6 @@ const extensions::Extension* GetExtension(WebContents* web_contents) {
web_contents->GetURL()); web_contents->GetURL());
} }
#if !defined(OS_ANDROID)
bool IsWhitelistedExtension(const extensions::Extension* extension) { bool IsWhitelistedExtension(const extensions::Extension* extension) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
...@@ -67,8 +69,7 @@ bool IsWhitelistedExtension(const extensions::Extension* extension) { ...@@ -67,8 +69,7 @@ bool IsWhitelistedExtension(const extensions::Extension* extension) {
return false; return false;
} }
#endif // defined(ENABLE_EXTENSIONS)
#endif // !defined(OS_ANDROID)
// Gets the security originator of the tab. It returns a string with no '/' // Gets the security originator of the tab. It returns a string with no '/'
// at the end to display in the UI. // at the end to display in the UI.
...@@ -96,9 +97,11 @@ base::string16 GetTitle(WebContents* web_contents) { ...@@ -96,9 +97,11 @@ base::string16 GetTitle(WebContents* web_contents) {
if (!web_contents) if (!web_contents)
return base::string16(); return base::string16();
#if defined(ENABLE_EXTENSIONS)
const extensions::Extension* const extension = GetExtension(web_contents); const extensions::Extension* const extension = GetExtension(web_contents);
if (extension) if (extension)
return base::UTF8ToUTF16(extension->name()); return base::UTF8ToUTF16(extension->name());
#endif
base::string16 tab_title = web_contents->GetTitle(); base::string16 tab_title = web_contents->GetTitle();
...@@ -426,7 +429,7 @@ void MediaStreamCaptureIndicator::UpdateNotificationUserInterface() { ...@@ -426,7 +429,7 @@ void MediaStreamCaptureIndicator::UpdateNotificationUserInterface() {
// The audio/video icon is shown only for non-whitelisted extensions or on // The audio/video icon is shown only for non-whitelisted extensions or on
// Android. For regular tabs on desktop, we show an indicator in the tab // Android. For regular tabs on desktop, we show an indicator in the tab
// icon. // icon.
#if !defined(OS_ANDROID) #if defined(ENABLE_EXTENSIONS)
const extensions::Extension* extension = GetExtension(web_contents); const extensions::Extension* extension = GetExtension(web_contents);
if (!extension || IsWhitelistedExtension(extension)) if (!extension || IsWhitelistedExtension(extension))
continue; continue;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "components/nacl/common/nacl_process_type.h" #include "components/nacl/common/nacl_process_type.h"
...@@ -24,11 +23,6 @@ ...@@ -24,11 +23,6 @@
#include "content/public/browser/render_widget_host_iterator.h" #include "content/public/browser/render_widget_host_iterator.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/bindings_policy.h" #include "content/public/common/bindings_policy.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension.h"
#include "grit/chromium_strings.h" #include "grit/chromium_strings.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
...@@ -37,6 +31,15 @@ ...@@ -37,6 +31,15 @@
#include "content/public/browser/zygote_host_linux.h" #include "content/public/browser/zygote_host_linux.h"
#endif #endif
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h"
#include "extensions/browser/process_map.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension.h"
#endif
using base::StringPrintf; using base::StringPrintf;
using content::BrowserChildProcessHostIterator; using content::BrowserChildProcessHostIterator;
using content::BrowserThread; using content::BrowserThread;
...@@ -44,7 +47,9 @@ using content::NavigationEntry; ...@@ -44,7 +47,9 @@ using content::NavigationEntry;
using content::RenderViewHost; using content::RenderViewHost;
using content::RenderWidgetHost; using content::RenderWidgetHost;
using content::WebContents; using content::WebContents;
#if defined(ENABLE_EXTENSIONS)
using extensions::Extension; using extensions::Extension;
#endif
// static // static
std::string ProcessMemoryInformation::GetRendererTypeNameInEnglish( std::string ProcessMemoryInformation::GetRendererTypeNameInEnglish(
...@@ -268,15 +273,6 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -268,15 +273,6 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
process.pid != base::GetProcId(render_process_host->GetHandle())) { process.pid != base::GetProcId(render_process_host->GetHandle())) {
continue; continue;
} }
process.process_type = content::PROCESS_TYPE_RENDERER;
content::BrowserContext* context =
render_process_host->GetBrowserContext();
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(context)->extension_service();
extensions::ProcessMap* extension_process_map = NULL;
// No extensions on Android. So extension_service can be NULL.
if (extension_service)
extension_process_map = extensions::ProcessMap::Get(context);
// The RenderProcessHost may host multiple WebContentses. Any // The RenderProcessHost may host multiple WebContentses. Any
// of them which contain diagnostics information make the whole // of them which contain diagnostics information make the whole
...@@ -284,7 +280,20 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -284,7 +280,20 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
if (!widget->IsRenderView()) if (!widget->IsRenderView())
continue; continue;
process.process_type = content::PROCESS_TYPE_RENDERER;
bool is_extension = false;
RenderViewHost* host = RenderViewHost::From(widget); RenderViewHost* host = RenderViewHost::From(widget);
#if defined(ENABLE_EXTENSIONS)
content::BrowserContext* context =
render_process_host->GetBrowserContext();
ExtensionService* extension_service =
extensions::ExtensionSystem::Get(context)->extension_service();
extensions::ProcessMap* extension_process_map =
extensions::ProcessMap::Get(context);
is_extension = extension_process_map->Contains(
host->GetProcess()->GetID());
#endif
WebContents* contents = WebContents::FromRenderViewHost(host); WebContents* contents = WebContents::FromRenderViewHost(host);
GURL url; GURL url;
if (contents) { if (contents) {
...@@ -293,11 +302,13 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -293,11 +302,13 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
&chrome_browser->site_data[contents->GetBrowserContext()]; &chrome_browser->site_data[contents->GetBrowserContext()];
SiteDetails::CollectSiteInfo(contents, site_data); SiteDetails::CollectSiteInfo(contents, site_data);
} }
#if defined(ENABLE_EXTENSIONS)
extensions::ViewType type = extensions::GetViewType(contents); extensions::ViewType type = extensions::GetViewType(contents);
#endif
if (host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI) { if (host->GetEnabledBindings() & content::BINDINGS_POLICY_WEB_UI) {
process.renderer_type = ProcessMemoryInformation::RENDERER_CHROME; process.renderer_type = ProcessMemoryInformation::RENDERER_CHROME;
} else if (extension_process_map && } else if (is_extension) {
extension_process_map->Contains(host->GetProcess()->GetID())) { #if defined(ENABLE_EXTENSIONS)
// For our purposes, don't count processes containing only hosted apps // For our purposes, don't count processes containing only hosted apps
// as extension processes. See also: crbug.com/102533. // as extension processes. See also: crbug.com/102533.
std::set<std::string> extension_ids = std::set<std::string> extension_ids =
...@@ -313,9 +324,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -313,9 +324,10 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
break; break;
} }
} }
#endif
} }
if (extension_process_map && #if defined(ENABLE_EXTENSIONS)
extension_process_map->Contains(host->GetProcess()->GetID())) { if (is_extension) {
const Extension* extension = const Extension* extension =
extension_service->extensions()->GetByID(url.host()); extension_service->extensions()->GetByID(url.host());
if (extension) { if (extension) {
...@@ -326,6 +338,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -326,6 +338,7 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
continue; continue;
} }
} }
#endif
if (!contents) { if (!contents) {
process.renderer_type = process.renderer_type =
...@@ -333,12 +346,14 @@ void MemoryDetails::CollectChildInfoOnUIThread() { ...@@ -333,12 +346,14 @@ void MemoryDetails::CollectChildInfoOnUIThread() {
continue; continue;
} }
#if defined(ENABLE_EXTENSIONS)
if (type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) { if (type == extensions::VIEW_TYPE_BACKGROUND_CONTENTS) {
process.titles.push_back(base::UTF8ToUTF16(url.spec())); process.titles.push_back(base::UTF8ToUTF16(url.spec()));
process.renderer_type = process.renderer_type =
ProcessMemoryInformation::RENDERER_BACKGROUND_APP; ProcessMemoryInformation::RENDERER_BACKGROUND_APP;
continue; continue;
} }
#endif
// Since we have a WebContents and and the renderer type hasn't been // Since we have a WebContents and and the renderer type hasn't been
// set yet, it must be a normal tabbed renderer. // set yet, it must be a normal tabbed renderer.
......
...@@ -29,15 +29,11 @@ ...@@ -29,15 +29,11 @@
#include "policy/policy_constants.h" #include "policy/policy_constants.h"
#if !defined(OS_IOS) #if !defined(OS_IOS)
#include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h"
#include "chrome/browser/extensions/policy_handlers.h"
#include "chrome/browser/net/disk_cache_dir_policy_handler.h" #include "chrome/browser/net/disk_cache_dir_policy_handler.h"
#include "chrome/browser/policy/file_selection_dialogs_policy_handler.h" #include "chrome/browser/policy/file_selection_dialogs_policy_handler.h"
#include "chrome/browser/policy/javascript_policy_handler.h" #include "chrome/browser/policy/javascript_policy_handler.h"
#include "chrome/browser/sessions/restore_on_startup_policy_handler.h" #include "chrome/browser/sessions/restore_on_startup_policy_handler.h"
#include "chrome/browser/sync/sync_policy_handler.h" #include "chrome/browser/sync/sync_policy_handler.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/manifest.h"
#endif #endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
...@@ -56,6 +52,13 @@ ...@@ -56,6 +52,13 @@
#include "apps/pref_names.h" #include "apps/pref_names.h"
#endif #endif
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/messaging/native_messaging_policy_handler.h"
#include "chrome/browser/extensions/policy_handlers.h"
#include "extensions/browser/pref_names.h"
#include "extensions/common/manifest.h"
#endif
namespace policy { namespace policy {
namespace { namespace {
...@@ -487,7 +490,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = { ...@@ -487,7 +490,7 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
#endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
}; };
#if !defined(OS_IOS) #if defined(ENABLE_EXTENSIONS)
void GetExtensionAllowedTypesMap( void GetExtensionAllowedTypesMap(
ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) {
// Mapping from extension type names to Manifest::Type. // Mapping from extension type names to Manifest::Type.
...@@ -510,7 +513,9 @@ void GetExtensionAllowedTypesMap( ...@@ -510,7 +513,9 @@ void GetExtensionAllowedTypesMap(
"platform_app", scoped_ptr<base::Value>(new base::FundamentalValue( "platform_app", scoped_ptr<base::Value>(new base::FundamentalValue(
extensions::Manifest::TYPE_PLATFORM_APP)))); extensions::Manifest::TYPE_PLATFORM_APP))));
} }
#endif
#if !defined(OS_IOS)
void GetDeprecatedFeaturesMap( void GetDeprecatedFeaturesMap(
ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) { ScopedVector<StringMappingListPolicyHandler::MappingEntry>* result) {
// Maps feature tags as specified in policy to the corresponding switch to // Maps feature tags as specified in policy to the corresponding switch to
...@@ -571,6 +576,14 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList( ...@@ -571,6 +576,14 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList(
handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>(
new browser_sync::SyncPolicyHandler())); new browser_sync::SyncPolicyHandler()));
handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>(
new StringMappingListPolicyHandler(
key::kEnableDeprecatedWebPlatformFeatures,
prefs::kEnableDeprecatedWebPlatformFeatures,
base::Bind(GetDeprecatedFeaturesMap))));
#endif // !defined(OS_IOS)
#if defined(ENABLE_EXTENSIONS)
handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>(
new extensions::ExtensionListPolicyHandler( new extensions::ExtensionListPolicyHandler(
key::kExtensionInstallWhitelist, key::kExtensionInstallWhitelist,
...@@ -592,12 +605,7 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList( ...@@ -592,12 +605,7 @@ scoped_ptr<ConfigurationPolicyHandlerList> BuildHandlerList(
key::kExtensionAllowedTypes, key::kExtensionAllowedTypes,
extensions::pref_names::kAllowedTypes, extensions::pref_names::kAllowedTypes,
base::Bind(GetExtensionAllowedTypesMap)))); base::Bind(GetExtensionAllowedTypesMap))));
handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( #endif
new StringMappingListPolicyHandler(
key::kEnableDeprecatedWebPlatformFeatures,
prefs::kEnableDeprecatedWebPlatformFeatures,
base::Bind(GetDeprecatedFeaturesMap))));
#endif // !defined(OS_IOS)
#if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS) #if !defined(OS_CHROMEOS) && !defined(OS_ANDROID) && !defined(OS_IOS)
handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>( handlers->AddHandler(make_scoped_ptr<ConfigurationPolicyHandler>(
......
...@@ -43,7 +43,6 @@ ...@@ -43,7 +43,6 @@
#include "components/sync_driver/pref_names.h" #include "components/sync_driver/pref_names.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "extensions/browser/pref_names.h"
#include "grit/browser_resources.h" #include "grit/browser_resources.h"
#include "grit/chromium_strings.h" #include "grit/chromium_strings.h"
#include "grit/generated_resources.h" #include "grit/generated_resources.h"
...@@ -55,6 +54,10 @@ ...@@ -55,6 +54,10 @@
#include "components/policy/core/common/policy_types.h" #include "components/policy/core/common/policy_types.h"
#endif #endif
#if defined(ENABLE_EXTENSIONS)
#include "extensions/browser/pref_names.h"
#endif
#if defined(ENABLE_MANAGED_USERS) #if defined(ENABLE_MANAGED_USERS)
#include "chrome/browser/supervised_user/supervised_user_pref_store.h" #include "chrome/browser/supervised_user/supervised_user_pref_store.h"
#endif #endif
...@@ -107,11 +110,13 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = { ...@@ -107,11 +110,13 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = {
PrefHashFilter::ENFORCE_ON_LOAD, PrefHashFilter::ENFORCE_ON_LOAD,
PrefHashFilter::TRACKING_STRATEGY_ATOMIC PrefHashFilter::TRACKING_STRATEGY_ATOMIC
}, },
#if defined(ENABLE_EXTENSIONS)
{ {
5, extensions::pref_names::kExtensions, 5, extensions::pref_names::kExtensions,
PrefHashFilter::NO_ENFORCEMENT, PrefHashFilter::NO_ENFORCEMENT,
PrefHashFilter::TRACKING_STRATEGY_SPLIT PrefHashFilter::TRACKING_STRATEGY_SPLIT
}, },
#endif
{ {
6, prefs::kGoogleServicesLastUsername, 6, prefs::kGoogleServicesLastUsername,
PrefHashFilter::ENFORCE_ON_LOAD, PrefHashFilter::ENFORCE_ON_LOAD,
...@@ -144,6 +149,7 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = { ...@@ -144,6 +149,7 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = {
PrefHashFilter::TRACKING_STRATEGY_ATOMIC PrefHashFilter::TRACKING_STRATEGY_ATOMIC
}, },
#endif #endif
#if defined(ENABLE_EXTENSIONS)
{ {
// This pref has been deprecated, leave it here for now for it to be // This pref has been deprecated, leave it here for now for it to be
// properly mapped back to Preferences and cleaned up from there. // properly mapped back to Preferences and cleaned up from there.
...@@ -151,6 +157,7 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = { ...@@ -151,6 +157,7 @@ const PrefHashFilter::TrackedPreferenceMetadata kTrackedPrefs[] = {
PrefHashFilter::NO_ENFORCEMENT, PrefHashFilter::NO_ENFORCEMENT,
PrefHashFilter::TRACKING_STRATEGY_ATOMIC PrefHashFilter::TRACKING_STRATEGY_ATOMIC
}, },
#endif
{ {
13, prefs::kProfileResetPromptMemento, 13, prefs::kProfileResetPromptMemento,
PrefHashFilter::ENFORCE_ON_LOAD, PrefHashFilter::ENFORCE_ON_LOAD,
...@@ -292,11 +299,13 @@ GetTrackingConfiguration() { ...@@ -292,11 +299,13 @@ GetTrackingConfiguration() {
data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD;
} }
#if defined(ENABLE_EXTENSIONS)
if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE && if (enforcement_group >= GROUP_ENFORCE_ALWAYS_WITH_EXTENSIONS_AND_DSE &&
data.name == extensions::pref_names::kExtensions) { data.name == extensions::pref_names::kExtensions) {
// Specifically enable extension settings enforcement. // Specifically enable extension settings enforcement.
data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD; data.enforcement_level = PrefHashFilter::ENFORCE_ON_LOAD;
} }
#endif
result.push_back(data); result.push_back(data);
} }
......
...@@ -30,15 +30,12 @@ ...@@ -30,15 +30,12 @@
#include "components/dom_distiller/content/web_contents_main_frame_observer.h" #include "components/dom_distiller/content/web_contents_main_frame_observer.h"
#include "components/password_manager/core/browser/password_manager.h" #include "components/password_manager/core/browser/password_manager.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "extensions/browser/view_type_utils.h"
#if defined(OS_ANDROID) #if defined(OS_ANDROID)
#include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h" #include "chrome/browser/android/webapps/single_tab_mode_tab_helper.h"
#include "chrome/browser/ui/android/context_menu_helper.h" #include "chrome/browser/ui/android/context_menu_helper.h"
#include "chrome/browser/ui/android/window_android_helper.h" #include "chrome/browser/ui/android/window_android_helper.h"
#else #else
#include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
#include "chrome/browser/net/predictor_tab_helper.h" #include "chrome/browser/net/predictor_tab_helper.h"
#include "chrome/browser/plugins/plugin_observer.h" #include "chrome/browser/plugins/plugin_observer.h"
#include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
...@@ -63,7 +60,10 @@ ...@@ -63,7 +60,10 @@
#endif #endif
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
#include "chrome/browser/extensions/chrome_extension_web_contents_observer.h"
#include "chrome/browser/extensions/tab_helper.h" #include "chrome/browser/extensions/tab_helper.h"
#include "extensions/browser/view_type_utils.h"
#endif #endif
#if defined(ENABLE_MANAGED_USERS) #if defined(ENABLE_MANAGED_USERS)
...@@ -104,8 +104,10 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) { ...@@ -104,8 +104,10 @@ void TabHelpers::AttachTabHelpers(WebContents* web_contents) {
web_contents->SetUserData(&kTabContentsAttachedTabHelpersUserDataKey, web_contents->SetUserData(&kTabContentsAttachedTabHelpersUserDataKey,
new base::SupportsUserData::Data()); new base::SupportsUserData::Data());
#if defined(ENABLE_EXTENSIONS)
// Set the view type. // Set the view type.
extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS); extensions::SetViewType(web_contents, extensions::VIEW_TYPE_TAB_CONTENTS);
#endif
// Create all the tab helpers. // Create all the tab helpers.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment