Commit 428c2caf authored by thestig's avatar thestig Committed by Commit bot

Android: Remove more browser extensions code, including some that snuck back in.

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

Cr-Commit-Position: refs/heads/master@{#293657}
parent 132fdfe1
...@@ -122,12 +122,6 @@ TEST_F(CookieSettingsTest, CookiesThirdPartyBlockedExplicitAllow) { ...@@ -122,12 +122,6 @@ TEST_F(CookieSettingsTest, CookiesThirdPartyBlockedExplicitAllow) {
kAllowedSite, kExtensionURL)); kAllowedSite, kExtensionURL));
EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed( EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed(
kAllowedSite, kExtensionURL)); kAllowedSite, kExtensionURL));
// Extensions should always be allowed to use cookies.
EXPECT_TRUE(cookie_settings_->IsReadingCookieAllowed(
kAllowedSite, kExtensionURL));
EXPECT_TRUE(cookie_settings_->IsSettingCookieAllowed(
kAllowedSite, kExtensionURL));
} }
TEST_F(CookieSettingsTest, CookiesThirdPartyBlockedAllSitesAllowed) { TEST_F(CookieSettingsTest, CookiesThirdPartyBlockedAllSitesAllowed) {
...@@ -266,9 +260,16 @@ TEST_F(CookieSettingsTest, ExtensionsRegularSettings) { ...@@ -266,9 +260,16 @@ TEST_F(CookieSettingsTest, ExtensionsRegularSettings) {
TEST_F(CookieSettingsTest, ExtensionsOwnCookies) { TEST_F(CookieSettingsTest, ExtensionsOwnCookies) {
cookie_settings_->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK); cookie_settings_->SetDefaultCookieSetting(CONTENT_SETTING_BLOCK);
#if defined(ENABLE_EXTENSIONS)
// Extensions can always use cookies (and site data) in their own origin. // Extensions can always use cookies (and site data) in their own origin.
EXPECT_TRUE(cookie_settings_->IsReadingCookieAllowed( EXPECT_TRUE(cookie_settings_->IsReadingCookieAllowed(
kExtensionURL, kExtensionURL)); kExtensionURL, kExtensionURL));
#else
// Except if extensions are disabled. Then the extension-specific checks do
// not exist and the default setting is to block.
EXPECT_FALSE(cookie_settings_->IsReadingCookieAllowed(
kExtensionURL, kExtensionURL));
#endif
} }
TEST_F(CookieSettingsTest, ExtensionsThirdParty) { TEST_F(CookieSettingsTest, ExtensionsThirdParty) {
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#include "chrome/browser/content_settings/content_settings_rule.h" #include "chrome/browser/content_settings/content_settings_rule.h"
#include "chrome/browser/content_settings/content_settings_utils.h" #include "chrome/browser/content_settings/content_settings_utils.h"
#include "chrome/browser/extensions/api/content_settings/content_settings_service.h" #include "chrome/browser/extensions/api/content_settings/content_settings_service.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
...@@ -36,12 +35,16 @@ ...@@ -36,12 +35,16 @@
#include "content/public/browser/notification_source.h" #include "content/public/browser/notification_source.h"
#include "content/public/browser/user_metrics.h" #include "content/public/browser/user_metrics.h"
#include "content/public/common/content_switches.h" #include "content/public/common/content_switches.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/constants.h"
#include "net/base/net_errors.h" #include "net/base/net_errors.h"
#include "net/base/static_cookie_policy.h" #include "net/base/static_cookie_policy.h"
#include "url/gurl.h" #include "url/gurl.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/common/constants.h"
#endif
using base::UserMetricsAction; using base::UserMetricsAction;
using content::BrowserThread; using content::BrowserThread;
...@@ -674,6 +677,7 @@ bool HostContentSettingsMap::ShouldAllowAllContent( ...@@ -674,6 +677,7 @@ bool HostContentSettingsMap::ShouldAllowAllContent(
primary_url.SchemeIsSecure()) { primary_url.SchemeIsSecure()) {
return true; return true;
} }
#if defined(ENABLE_EXTENSIONS)
if (primary_url.SchemeIs(extensions::kExtensionScheme)) { if (primary_url.SchemeIs(extensions::kExtensionScheme)) {
switch (content_type) { switch (content_type) {
case CONTENT_SETTINGS_TYPE_PLUGINS: case CONTENT_SETTINGS_TYPE_PLUGINS:
...@@ -687,6 +691,7 @@ bool HostContentSettingsMap::ShouldAllowAllContent( ...@@ -687,6 +691,7 @@ bool HostContentSettingsMap::ShouldAllowAllContent(
return true; return true;
} }
} }
#endif
return primary_url.SchemeIs(content::kChromeDevToolsScheme) || return primary_url.SchemeIs(content::kChromeDevToolsScheme) ||
primary_url.SchemeIs(content::kChromeUIScheme); primary_url.SchemeIs(content::kChromeUIScheme);
} }
......
...@@ -935,8 +935,13 @@ TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) { ...@@ -935,8 +935,13 @@ TEST_F(HostContentSettingsMapTest, ShouldAllowAllContent) {
https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES)); https_host, embedder, CONTENT_SETTINGS_TYPE_COOKIES));
EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
embedder, http_host, CONTENT_SETTINGS_TYPE_COOKIES)); embedder, http_host, CONTENT_SETTINGS_TYPE_COOKIES));
#if defined(ENABLE_EXTENSIONS)
EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent( EXPECT_TRUE(host_content_settings_map->ShouldAllowAllContent(
extension, extension, CONTENT_SETTINGS_TYPE_COOKIES)); extension, extension, CONTENT_SETTINGS_TYPE_COOKIES));
#else
EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
extension, extension, CONTENT_SETTINGS_TYPE_COOKIES));
#endif
EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS)); extension, extension, CONTENT_SETTINGS_TYPE_PLUGINS));
EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent( EXPECT_FALSE(host_content_settings_map->ShouldAllowAllContent(
......
...@@ -5,38 +5,10 @@ ...@@ -5,38 +5,10 @@
// Download code which handles CRX files (extensions, themes, apps, ...). // Download code which handles CRX files (extensions, themes, apps, ...).
#include "chrome/browser/download/download_crx_util.h" #include "chrome/browser/download/download_crx_util.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/browser/download_item.h"
using content::BrowserThread;
using content::DownloadItem;
namespace download_crx_util { namespace download_crx_util {
scoped_refptr<extensions::CrxInstaller> CreateCrxInstaller( bool IsExtensionDownload(const content::DownloadItem& download_item) {
Profile* profile,
const content::DownloadItem& download_item) {
NOTIMPLEMENTED() << "CrxInstaller not implemented on Android";
scoped_refptr<extensions::CrxInstaller> installer(
extensions::CrxInstaller::CreateSilent(NULL));
return installer;
}
void SetMockInstallPromptForTesting(ExtensionInstallPrompt* mock_prompt) {
NOTIMPLEMENTED();
}
scoped_refptr<extensions::CrxInstaller> OpenChromeExtension(
Profile* profile,
const DownloadItem& download_item) {
NOTIMPLEMENTED() << "CrxInstaller not implemented on Android";
scoped_refptr<extensions::CrxInstaller> installer(
extensions::CrxInstaller::CreateSilent(NULL));
return installer;
}
bool IsExtensionDownload(const DownloadItem& download_item) {
// Extensions are not supported on Android. We want to treat them as // Extensions are not supported on Android. We want to treat them as
// normal file downloads. // normal file downloads.
return false; return false;
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "chrome/browser/content_settings/content_settings_provider.h" #include "chrome/browser/content_settings/content_settings_provider.h"
#include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/content_settings/host_content_settings_map.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/media/desktop_streams_registry.h" #include "chrome/browser/media/desktop_streams_registry.h"
#include "chrome/browser/media/media_stream_capture_indicator.h" #include "chrome/browser/media/media_stream_capture_indicator.h"
#include "chrome/browser/media/media_stream_device_permissions.h" #include "chrome/browser/media/media_stream_device_permissions.h"
...@@ -42,9 +41,6 @@ ...@@ -42,9 +41,6 @@
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/media_stream_request.h" #include "content/public/common/media_stream_request.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "extensions/common/permissions/permissions_data.h" #include "extensions/common/permissions/permissions_data.h"
...@@ -67,6 +63,10 @@ ...@@ -67,6 +63,10 @@
#if defined(ENABLE_EXTENSIONS) #if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h" #include "chrome/browser/extensions/api/tab_capture/tab_capture_registry.h"
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/app_window/app_window.h"
#include "extensions/browser/app_window/app_window_registry.h"
#include "extensions/browser/extension_system.h"
#endif #endif
using content::BrowserThread; using content::BrowserThread;
...@@ -673,7 +673,6 @@ void MediaCaptureDevicesDispatcher:: ...@@ -673,7 +673,6 @@ void MediaCaptureDevicesDispatcher::
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback, const content::MediaResponseCallback& callback,
const extensions::Extension* extension) { const extensions::Extension* extension) {
// TODO(vrk): This code is largely duplicated in // TODO(vrk): This code is largely duplicated in
// MediaStreamDevicesController::Accept(). Move this code into a shared method // MediaStreamDevicesController::Accept(). Move this code into a shared method
// between the two classes. // between the two classes.
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h" #include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/browser/performance_monitor/constants.h" #include "chrome/browser/performance_monitor/constants.h"
#include "chrome/browser/performance_monitor/performance_monitor_util.h" #include "chrome/browser/performance_monitor/performance_monitor_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
...@@ -28,7 +27,6 @@ ...@@ -28,7 +27,6 @@
#include "chrome/browser/ui/browser_iterator.h" #include "chrome/browser/ui/browser_iterator.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
#include "chrome/common/chrome_version_info.h" #include "chrome/common/chrome_version_info.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/public/browser/browser_child_process_host.h" #include "content/public/browser/browser_child_process_host.h"
#include "content/public/browser/browser_child_process_host_iterator.h" #include "content/public/browser/browser_child_process_host_iterator.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
...@@ -40,12 +38,20 @@ ...@@ -40,12 +38,20 @@
#include "content/public/browser/render_widget_host.h" #include "content/public/browser/render_widget_host.h"
#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 "extensions/common/extension.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/crx_installer.h"
#include "chrome/common/extensions/extension_constants.h"
#include "extensions/common/extension.h"
#endif
using content::BrowserThread; using content::BrowserThread;
#if defined(ENABLE_EXTENSIONS)
using extensions::Extension; using extensions::Extension;
using extensions::UnloadedExtensionInfo; using extensions::UnloadedExtensionInfo;
#endif
namespace performance_monitor { namespace performance_monitor {
...@@ -400,7 +406,6 @@ void PerformanceMonitor::GatherMetricsMapOnUIThread() { ...@@ -400,7 +406,6 @@ void PerformanceMonitor::GatherMetricsMapOnUIThread() {
void PerformanceMonitor::MarkProcessAsAlive(const base::ProcessHandle& handle, void PerformanceMonitor::MarkProcessAsAlive(const base::ProcessHandle& handle,
int process_type, int process_type,
int current_update_sequence) { int current_update_sequence) {
if (handle == 0) { if (handle == 0) {
// Process may not be valid yet. // Process may not be valid yet.
return; return;
...@@ -560,6 +565,7 @@ void PerformanceMonitor::Observe(int type, ...@@ -560,6 +565,7 @@ void PerformanceMonitor::Observe(int type,
DCHECK(database_logging_enabled_); DCHECK(database_logging_enabled_);
switch (type) { switch (type) {
#if defined(ENABLE_EXTENSIONS)
case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: { case extensions::NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED: {
AddExtensionEvent( AddExtensionEvent(
EVENT_EXTENSION_INSTALL, EVENT_EXTENSION_INSTALL,
...@@ -602,6 +608,7 @@ void PerformanceMonitor::Observe(int type, ...@@ -602,6 +608,7 @@ void PerformanceMonitor::Observe(int type,
content::Details<Extension>(details).ptr()); content::Details<Extension>(details).ptr());
break; break;
} }
#endif // defined(ENABLE_EXTENSIONS)
case content::NOTIFICATION_RENDER_WIDGET_HOST_HANG: { case content::NOTIFICATION_RENDER_WIDGET_HOST_HANG: {
std::string url; std::string url;
content::RenderWidgetHost* widget = content::RenderWidgetHost* widget =
...@@ -659,6 +666,7 @@ void PerformanceMonitor::Observe(int type, ...@@ -659,6 +666,7 @@ void PerformanceMonitor::Observe(int type,
} }
} }
#if defined(ENABLE_EXTENSIONS)
void PerformanceMonitor::AddExtensionEvent(EventType type, void PerformanceMonitor::AddExtensionEvent(EventType type,
const Extension* extension) { const Extension* extension) {
DCHECK(type == EVENT_EXTENSION_INSTALL || DCHECK(type == EVENT_EXTENSION_INSTALL ||
...@@ -675,6 +683,7 @@ void PerformanceMonitor::AddExtensionEvent(EventType type, ...@@ -675,6 +683,7 @@ void PerformanceMonitor::AddExtensionEvent(EventType type,
extension->VersionString(), extension->VersionString(),
extension->description())); extension->description()));
} }
#endif // defined(ENABLE_EXTENSIONS)
void PerformanceMonitor::AddRendererClosedEvent( void PerformanceMonitor::AddRendererClosedEvent(
content::RenderProcessHost* host, content::RenderProcessHost* host,
......
...@@ -173,10 +173,12 @@ class PerformanceMonitor : public content::NotificationObserver { ...@@ -173,10 +173,12 @@ class PerformanceMonitor : public content::NotificationObserver {
void GatherMetricsMapOnUIThread(); void GatherMetricsMapOnUIThread();
void GatherMetricsMapOnIOThread(int current_update_sequence); void GatherMetricsMapOnIOThread(int current_update_sequence);
#if defined(ENABLE_EXTENSIONS)
// Generate an appropriate ExtensionEvent for an extension-related occurrance // Generate an appropriate ExtensionEvent for an extension-related occurrance
// and insert it in the database. // and insert it in the database.
void AddExtensionEvent(EventType type, void AddExtensionEvent(EventType type,
const extensions::Extension* extension); const extensions::Extension* extension);
#endif
// Generate an appropriate RendererFailure for a renderer crash and insert it // Generate an appropriate RendererFailure for a renderer crash and insert it
// in the database. // in the database.
......
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
#include "chrome/browser/ui/startup/autolaunch_prompt.h" #include "chrome/browser/ui/startup/autolaunch_prompt.h"
#include "chrome/browser/ui/startup/default_browser_prompt.h" #include "chrome/browser/ui/startup/default_browser_prompt.h"
#include "chrome/browser/ui/tabs/pinned_tab_codec.h" #include "chrome/browser/ui/tabs/pinned_tab_codec.h"
#include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
#include "chrome/browser/ui/webui/flags_ui.h" #include "chrome/browser/ui/webui/flags_ui.h"
#include "chrome/browser/ui/webui/instant_ui.h" #include "chrome/browser/ui/webui/instant_ui.h"
#include "chrome/browser/ui/webui/ntp/new_tab_ui.h" #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
...@@ -113,6 +112,7 @@ ...@@ -113,6 +112,7 @@
#include "chrome/browser/extensions/extension_web_ui.h" #include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/extensions/launch_util.h" #include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/signin/easy_unlock_service.h" #include "chrome/browser/signin/easy_unlock_service.h"
#include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
#include "extensions/browser/extension_prefs.h" #include "extensions/browser/extension_prefs.h"
#endif #endif
......
...@@ -55,25 +55,28 @@ ...@@ -55,25 +55,28 @@
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h" #include "content/public/browser/notification_service.h"
#include "content/public/browser/user_metrics.h" #include "content/public/browser/user_metrics.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest.h"
#include "net/http/http_transaction_factory.h" #include "net/http/http_transaction_factory.h"
#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_context_getter.h"
#include "net/url_request/url_request_job.h" #include "net/url_request/url_request_job.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/browser/extension_system.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest.h"
#endif
#if defined(ENABLE_MANAGED_USERS) #if defined(ENABLE_MANAGED_USERS)
#include "chrome/browser/supervised_user/supervised_user_service.h" #include "chrome/browser/supervised_user/supervised_user_service.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h" #include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#endif #endif
#if !defined(OS_IOS) #if !defined(OS_IOS)
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/sessions/session_service_factory.h" #include "chrome/browser/sessions/session_service_factory.h"
#include "chrome/browser/ui/browser_list.h" #include "chrome/browser/ui/browser_list.h"
#include "extensions/browser/extension_system.h"
#endif // !defined (OS_IOS) #endif // !defined (OS_IOS)
#if defined(OS_WIN) #if defined(OS_WIN)
...@@ -84,7 +87,6 @@ ...@@ -84,7 +87,6 @@
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "chrome/browser/browser_process_platform_part_chromeos.h" #include "chrome/browser/browser_process_platform_part_chromeos.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chromeos/chromeos_switches.h" #include "chromeos/chromeos_switches.h"
#include "chromeos/dbus/cryptohome_client.h" #include "chromeos/dbus/cryptohome_client.h"
#include "chromeos/dbus/dbus_thread_manager.h" #include "chromeos/dbus/dbus_thread_manager.h"
......
...@@ -27,11 +27,14 @@ ...@@ -27,11 +27,14 @@
#include "components/search/search.h" #include "components/search/search.h"
#include "components/user_prefs/user_prefs.h" #include "components/user_prefs/user_prefs.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#include "net/base/net_util.h" #include "net/base/net_util.h"
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#endif
namespace chrome { namespace chrome {
int num_bookmark_urls_before_prompting = 15; int num_bookmark_urls_before_prompting = 15;
...@@ -154,6 +157,7 @@ void GetURLsForOpenTabs(Browser* browser, ...@@ -154,6 +157,7 @@ void GetURLsForOpenTabs(Browser* browser,
// Indicates how the bookmark shortcut has been changed by extensions associated // Indicates how the bookmark shortcut has been changed by extensions associated
// with |profile|, if at all. // with |profile|, if at all.
BookmarkShortcutDisposition GetBookmarkShortcutDisposition(Profile* profile) { BookmarkShortcutDisposition GetBookmarkShortcutDisposition(Profile* profile) {
#if defined(ENABLE_EXTENSIONS)
extensions::CommandService* command_service = extensions::CommandService* command_service =
extensions::CommandService::Get(profile); extensions::CommandService::Get(profile);
...@@ -183,6 +187,7 @@ BookmarkShortcutDisposition GetBookmarkShortcutDisposition(Profile* profile) { ...@@ -183,6 +187,7 @@ BookmarkShortcutDisposition GetBookmarkShortcutDisposition(Profile* profile) {
if (removed) if (removed)
return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED; return BOOKMARK_SHORTCUT_DISPOSITION_REMOVED;
#endif
return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED; return BOOKMARK_SHORTCUT_DISPOSITION_UNCHANGED;
} }
...@@ -348,6 +353,7 @@ bool ShouldRemoveBookmarkThisPageUI(Profile* profile) { ...@@ -348,6 +353,7 @@ bool ShouldRemoveBookmarkThisPageUI(Profile* profile) {
} }
bool ShouldRemoveBookmarkOpenPagesUI(Profile* profile) { bool ShouldRemoveBookmarkOpenPagesUI(Profile* profile) {
#if defined(ENABLE_EXTENSIONS)
extensions::ExtensionRegistry* registry = extensions::ExtensionRegistry* registry =
extensions::ExtensionRegistry::Get(profile); extensions::ExtensionRegistry::Get(profile);
if (!registry) if (!registry)
...@@ -362,6 +368,7 @@ bool ShouldRemoveBookmarkOpenPagesUI(Profile* profile) { ...@@ -362,6 +368,7 @@ bool ShouldRemoveBookmarkOpenPagesUI(Profile* profile) {
if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(i->get())) if (extensions::CommandService::RemovesBookmarkOpenPagesShortcut(i->get()))
return true; return true;
} }
#endif
return false; return false;
} }
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#include "chrome/browser/ui/browser_instant_controller.h" #include "chrome/browser/ui/browser_instant_controller.h"
#include "base/bind.h" #include "base/bind.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_web_ui.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_service.h" #include "chrome/browser/search/instant_service.h"
#include "chrome/browser/search/instant_service_factory.h" #include "chrome/browser/search/instant_service_factory.h"
......
...@@ -4,11 +4,14 @@ ...@@ -4,11 +4,14 @@
#include "chrome/browser/ui/media_utils.h" #include "chrome/browser/ui/media_utils.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/media/media_capture_devices_dispatcher.h" #include "chrome/browser/media/media_capture_devices_dispatcher.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#if defined(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/common/constants.h" #include "extensions/common/constants.h"
#endif
class Profile; class Profile;
...@@ -22,6 +25,7 @@ void RequestMediaAccessPermission( ...@@ -22,6 +25,7 @@ void RequestMediaAccessPermission(
const content::MediaStreamRequest& request, const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) { const content::MediaResponseCallback& callback) {
const extensions::Extension* extension = NULL; const extensions::Extension* extension = NULL;
#if defined(ENABLE_EXTENSIONS)
GURL origin(request.security_origin); GURL origin(request.security_origin);
if (origin.SchemeIs(extensions::kExtensionScheme)) { if (origin.SchemeIs(extensions::kExtensionScheme)) {
ExtensionService* extensions_service = ExtensionService* extensions_service =
...@@ -29,6 +33,7 @@ void RequestMediaAccessPermission( ...@@ -29,6 +33,7 @@ void RequestMediaAccessPermission(
extension = extensions_service->extensions()->GetByID(origin.host()); extension = extensions_service->extensions()->GetByID(origin.host());
DCHECK(extension); DCHECK(extension);
} }
#endif
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest( MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
web_contents, request, callback, extension); web_contents, request, callback, extension);
......
...@@ -392,14 +392,8 @@ ...@@ -392,14 +392,8 @@
'browser/download/save_package_file_picker.h', 'browser/download/save_package_file_picker.h',
'browser/enumerate_modules_model_win.cc', 'browser/enumerate_modules_model_win.cc',
'browser/enumerate_modules_model_win.h', 'browser/enumerate_modules_model_win.h',
'browser/extensions/signin/gaia_auth_extension_loader.cc', # Oh hey, all the cool browser/extensions files are hanging out in
'browser/extensions/signin/gaia_auth_extension_loader.h', # chrome/chrome_browser_extensions.gypi.
'browser/extensions/signin/scoped_gaia_auth_extension.cc',
'browser/extensions/signin/scoped_gaia_auth_extension.h',
'browser/extensions/token_cache/token_cache_service.cc',
'browser/extensions/token_cache/token_cache_service.h',
'browser/extensions/token_cache/token_cache_service_factory.cc',
'browser/extensions/token_cache/token_cache_service_factory.h',
'browser/external_protocol/external_protocol_handler.cc', 'browser/external_protocol/external_protocol_handler.cc',
'browser/external_protocol/external_protocol_handler.h', 'browser/external_protocol/external_protocol_handler.h',
'browser/favicon/chrome_favicon_client.cc', 'browser/favicon/chrome_favicon_client.cc',
...@@ -1384,15 +1378,6 @@ ...@@ -1384,15 +1378,6 @@
'browser/upgrade_detector.h', 'browser/upgrade_detector.h',
'browser/upload_list.cc', 'browser/upload_list.cc',
'browser/upload_list.h', 'browser/upload_list.h',
'browser/web_applications/update_shortcut_worker_win.cc',
'browser/web_applications/update_shortcut_worker_win.h',
'browser/web_applications/web_app.cc',
'browser/web_applications/web_app.h',
'browser/web_applications/web_app_chromeos.cc',
'browser/web_applications/web_app_mac.h',
'browser/web_applications/web_app_mac.mm',
'browser/web_applications/web_app_win.h',
'browser/web_applications/web_app_win.cc',
'browser/web_resource/eula_accepted_notifier.cc', 'browser/web_resource/eula_accepted_notifier.cc',
'browser/web_resource/eula_accepted_notifier.h', 'browser/web_resource/eula_accepted_notifier.h',
'browser/web_resource/json_asynchronous_unpacker.cc', 'browser/web_resource/json_asynchronous_unpacker.cc',
......
...@@ -793,6 +793,10 @@ ...@@ -793,6 +793,10 @@
'browser/extensions/shared_module_service.h', 'browser/extensions/shared_module_service.h',
'browser/extensions/shared_user_script_master.cc', 'browser/extensions/shared_user_script_master.cc',
'browser/extensions/shared_user_script_master.h', 'browser/extensions/shared_user_script_master.h',
'browser/extensions/signin/gaia_auth_extension_loader.cc',
'browser/extensions/signin/gaia_auth_extension_loader.h',
'browser/extensions/signin/scoped_gaia_auth_extension.cc',
'browser/extensions/signin/scoped_gaia_auth_extension.h',
'browser/extensions/standard_management_policy_provider.cc', 'browser/extensions/standard_management_policy_provider.cc',
'browser/extensions/standard_management_policy_provider.h', 'browser/extensions/standard_management_policy_provider.h',
'browser/extensions/startup_helper.cc', 'browser/extensions/startup_helper.cc',
...@@ -806,6 +810,10 @@ ...@@ -806,6 +810,10 @@
'browser/extensions/tab_helper.h', 'browser/extensions/tab_helper.h',
'browser/extensions/theme_installed_infobar_delegate.cc', 'browser/extensions/theme_installed_infobar_delegate.cc',
'browser/extensions/theme_installed_infobar_delegate.h', 'browser/extensions/theme_installed_infobar_delegate.h',
'browser/extensions/token_cache/token_cache_service.cc',
'browser/extensions/token_cache/token_cache_service.h',
'browser/extensions/token_cache/token_cache_service_factory.cc',
'browser/extensions/token_cache/token_cache_service_factory.h',
'browser/extensions/unpacked_installer.cc', 'browser/extensions/unpacked_installer.cc',
'browser/extensions/unpacked_installer.h', 'browser/extensions/unpacked_installer.h',
'browser/extensions/updater/extension_cache.cc', 'browser/extensions/updater/extension_cache.cc',
...@@ -853,6 +861,15 @@ ...@@ -853,6 +861,15 @@
'browser/extensions/window_controller_list_observer.h', 'browser/extensions/window_controller_list_observer.h',
'browser/extensions/zipfile_installer.cc', 'browser/extensions/zipfile_installer.cc',
'browser/extensions/zipfile_installer.h', 'browser/extensions/zipfile_installer.h',
'browser/web_applications/update_shortcut_worker_win.cc',
'browser/web_applications/update_shortcut_worker_win.h',
'browser/web_applications/web_app.cc',
'browser/web_applications/web_app.h',
'browser/web_applications/web_app_chromeos.cc',
'browser/web_applications/web_app_mac.h',
'browser/web_applications/web_app_mac.mm',
'browser/web_applications/web_app_win.h',
'browser/web_applications/web_app_win.cc',
], ],
'chrome_browser_extensions_app_list_sources': [ 'chrome_browser_extensions_app_list_sources': [
'browser/apps/drive/drive_app_converter.cc', 'browser/apps/drive/drive_app_converter.cc',
......
...@@ -7,14 +7,20 @@ ...@@ -7,14 +7,20 @@
#include "base/bind.h" #include "base/bind.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/url_constants.h" #include "content/public/common/url_constants.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
#if defined(ENABLE_EXTENSIONS)
#include "extensions/browser/extension_system.h" #include "extensions/browser/extension_system.h"
#include "extensions/browser/process_manager.h" #include "extensions/browser/process_manager.h"
#include "extensions/common/extension.h" #include "extensions/common/extension.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h" #endif
using blink::WebContextMenuData; using blink::WebContextMenuData;
using content::WebContents; using content::WebContents;
#if defined(ENABLE_EXTENSIONS)
using extensions::Extension; using extensions::Extension;
#endif
namespace { namespace {
...@@ -42,6 +48,7 @@ ContextMenuContentType::ContextMenuContentType( ...@@ -42,6 +48,7 @@ ContextMenuContentType::ContextMenuContentType(
ContextMenuContentType::~ContextMenuContentType() { ContextMenuContentType::~ContextMenuContentType() {
} }
#if defined(ENABLE_EXTENSIONS)
const Extension* ContextMenuContentType::GetExtension() const { const Extension* ContextMenuContentType::GetExtension() const {
extensions::ExtensionSystem* system = extensions::ExtensionSystem::Get( extensions::ExtensionSystem* system = extensions::ExtensionSystem::Get(
source_web_contents_->GetBrowserContext()); source_web_contents_->GetBrowserContext());
...@@ -52,6 +59,7 @@ const Extension* ContextMenuContentType::GetExtension() const { ...@@ -52,6 +59,7 @@ const Extension* ContextMenuContentType::GetExtension() const {
return system->process_manager()->GetExtensionForRenderViewHost( return system->process_manager()->GetExtensionForRenderViewHost(
source_web_contents_->GetRenderViewHost()); source_web_contents_->GetRenderViewHost());
} }
#endif
bool ContextMenuContentType::SupportsGroup(int group) { bool ContextMenuContentType::SupportsGroup(int group) {
const bool has_selection = !params_.selection_text.empty(); const bool has_selection = !params_.selection_text.empty();
...@@ -109,7 +117,6 @@ bool ContextMenuContentType::SupportsGroupInternal(int group) { ...@@ -109,7 +117,6 @@ bool ContextMenuContentType::SupportsGroupInternal(int group) {
} }
case ITEM_GROUP_FRAME: { case ITEM_GROUP_FRAME: {
bool page_group_supported = SupportsGroupInternal(ITEM_GROUP_PAGE); bool page_group_supported = SupportsGroupInternal(ITEM_GROUP_PAGE);
return page_group_supported && !params_.frame_url.is_empty() && return page_group_supported && !params_.frame_url.is_empty() &&
!IsInternalResourcesURL(params_.page_url); !IsInternalResourcesURL(params_.page_url);
......
...@@ -15,10 +15,6 @@ ...@@ -15,10 +15,6 @@
#include "content/public/browser/render_widget_host_view.h" #include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
#include "content/public/common/menu_item.h" #include "content/public/common/menu_item.h"
#include "extensions/browser/extension_host.h"
#include "extensions/browser/extension_system.h"
#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h" #include "third_party/WebKit/public/web/WebContextMenuData.h"
using blink::WebContextMenuData; using blink::WebContextMenuData;
......
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