summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 22:56:39 +0000
committergbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-26 22:56:39 +0000
commit325d03405283095a8b1f315da224dbd11377488b (patch)
tree4802ae0595dc563cfb2260bf68399b2cc9d1bed3
parentea0a505eb5076a40cbc6453fe46f028875f6b3c0 (diff)
downloadchromium_src-325d03405283095a8b1f315da224dbd11377488b.zip
chromium_src-325d03405283095a8b1f315da224dbd11377488b.tar.gz
chromium_src-325d03405283095a8b1f315da224dbd11377488b.tar.bz2
Revert 119284 - Turn web intents build flag on. Move the command-line flag to default on.
Make the flag disable rather than enable web intents. Put the options UI behind a new flag controlling functionality if the registration tag is present for web content. IN CASE OF FIRE, PULL THIS HANDLE! If web intents needs to be disabled, revert this change. R=jhawkins@chromium.org BUG=90458 TEST=None Review URL: https://chromiumcodereview.appspot.com/9212036 TBR=gbillock@chromium.org Review URL: https://chromiumcodereview.appspot.com/9113095 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119306 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--build/common.gypi14
-rw-r--r--chrome/browser/content_settings/host_content_settings_map.cc3
-rw-r--r--chrome/browser/resources/options/options.html4
-rw-r--r--chrome/browser/resources/options/options_bundle.js2
-rw-r--r--chrome/browser/resources/options2/content_settings.html2
-rw-r--r--chrome/browser/resources/options2/options.html4
-rw-r--r--chrome/browser/resources/options2/options_bundle.js2
-rw-r--r--chrome/browser/ui/browser.cc4
-rw-r--r--chrome/browser/ui/webui/options/content_settings_handler.cc10
-rw-r--r--chrome/browser/ui/webui/options2/content_settings_handler2.cc10
-rw-r--r--chrome/common/extensions/extension.cc2
-rw-r--r--chrome/common/extensions/extension_manifests_unittest.cc4
-rw-r--r--content/browser/intents/intent_injector.cc6
-rw-r--r--content/public/common/content_switches.cc2
-rw-r--r--content/public/common/content_switches.h2
15 files changed, 35 insertions, 36 deletions
diff --git a/build/common.gypi b/build/common.gypi
index 8d5f422..a4deaca 100644
--- a/build/common.gypi
+++ b/build/common.gypi
@@ -220,13 +220,8 @@
# Enable navigator.registerProtocolHandler and supporting UI.
'enable_register_protocol_handler%': 1,
- # Enable Web Intents support in WebKit, dispatching of intents,
- # and extensions Web Intents support.
- 'enable_web_intents%': 1,
-
- # Enable Web Intents web content registration via HTML element
- # and WebUI managing such registrations.
- 'enable_web_intents_tag%': 0,
+ # Enable Web Intents and supporting UI.
+ 'enable_web_intents%': 0,
# Webrtc compilation is enabled by default. Set to 0 to disable.
'enable_webrtc%': 1,
@@ -451,7 +446,6 @@
'order_text_section%': '<(order_text_section)',
'enable_register_protocol_handler%': '<(enable_register_protocol_handler)',
'enable_web_intents%': '<(enable_web_intents)',
- 'enable_web_intents_tag%': '<(enable_web_intents_tag)',
'enable_plugin_installation%': '<(enable_plugin_installation)',
'use_canvas_skia_skia%': '<(use_canvas_skia_skia)',
# Whether to build for Wayland display server
@@ -930,8 +924,8 @@
'grit_defines': ['-D', 'enable_register_protocol_handler'],
}],
- ['enable_web_intents_tag==1', {
- 'grit_defines': ['-D', 'enable_web_intents_tag'],
+ ['enable_web_intents==1', {
+ 'grit_defines': ['-D', 'enable_web_intents'],
}],
['asan==1', {
diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc
index 93fdb49..82eacba 100644
--- a/chrome/browser/content_settings/host_content_settings_map.cc
+++ b/chrome/browser/content_settings/host_content_settings_map.cc
@@ -311,7 +311,8 @@ bool HostContentSettingsMap::IsSettingAllowedForType(
ContentSetting setting, ContentSettingsType content_type) {
// Intents content settings are hidden behind a switch for now.
if (content_type == CONTENT_SETTINGS_TYPE_INTENTS &&
- CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents))
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents))
return false;
// BLOCK semantics are not implemented for fullscreen.
diff --git a/chrome/browser/resources/options/options.html b/chrome/browser/resources/options/options.html
index 8ded164..cfd82ff 100644
--- a/chrome/browser/resources/options/options.html
+++ b/chrome/browser/resources/options/options.html
@@ -30,7 +30,7 @@
<link rel="stylesheet" href="handler_options.css">
</if>
<link rel="stylesheet" href="import_data_overlay.css">
-<if expr="pp_ifdef('enable_web_intents_tag')">
+<if expr="pp_ifdef('enable_web_intents')">
<link rel="stylesheet" href="intents_view.css">
</if>
<link rel="stylesheet" href="language_options.css">
@@ -175,7 +175,7 @@
<if expr="pp_ifdef('enable_register_protocol_handler')">
<include src="handler_options.html">
</if>
- <if expr="pp_ifdef('enable_web_intents_tag')">
+ <if expr="pp_ifdef('enable_web_intents')">
<include src="intents_view.html">
</if>
<include src="content_settings_exceptions_area.html">
diff --git a/chrome/browser/resources/options/options_bundle.js b/chrome/browser/resources/options/options_bundle.js
index d156edb..0298858 100644
--- a/chrome/browser/resources/options/options_bundle.js
+++ b/chrome/browser/resources/options/options_bundle.js
@@ -76,7 +76,7 @@
</if>
<include src="import_data_overlay.js"></include>
<include src="instant_confirm_overlay.js"></include>
-<if expr="pp_ifdef('enable_web_intents_tag')">
+<if expr="pp_ifdef('enable_web_intents')">
<include src="intents_list.js"></include>
<include src="intents_view.js"></include>
</if>
diff --git a/chrome/browser/resources/options2/content_settings.html b/chrome/browser/resources/options2/content_settings.html
index ba62d90..bd21b0c 100644
--- a/chrome/browser/resources/options2/content_settings.html
+++ b/chrome/browser/resources/options2/content_settings.html
@@ -246,7 +246,7 @@
</div>
</section>
<!-- Intent registration filter tab contents -->
- <if expr="pp_ifdef('enable_web_intents_tag')">
+ <if expr="pp_ifdef('enable_web_intents')">
<section id="intents-section">
<h3 i18n-content="intentsTabLabel" class="content-settings-header"></h3>
<div>
diff --git a/chrome/browser/resources/options2/options.html b/chrome/browser/resources/options2/options.html
index 2d504c0..fcaacbb 100644
--- a/chrome/browser/resources/options2/options.html
+++ b/chrome/browser/resources/options2/options.html
@@ -28,7 +28,7 @@
<link rel="stylesheet" href="handler_options.css">
</if>
<link rel="stylesheet" href="import_data_overlay.css">
-<if expr="pp_ifdef('enable_web_intents_tag')">
+<if expr="pp_ifdef('enable_web_intents')">
<link rel="stylesheet" href="intents_view.css">
</if>
<link rel="stylesheet" href="language_options.css">
@@ -171,7 +171,7 @@
<if expr="pp_ifdef('enable_register_protocol_handler')">
<include src="handler_options.html">
</if>
- <if expr="pp_ifdef('enable_web_intents_tag')">
+ <if expr="pp_ifdef('enable_web_intents')">
<include src="intents_view.html">
</if>
<include src="content_settings_exceptions_area.html">
diff --git a/chrome/browser/resources/options2/options_bundle.js b/chrome/browser/resources/options2/options_bundle.js
index 9b22548..dc930ba 100644
--- a/chrome/browser/resources/options2/options_bundle.js
+++ b/chrome/browser/resources/options2/options_bundle.js
@@ -77,7 +77,7 @@
<include src="home_page_overlay.js"></include>
<include src="import_data_overlay.js"></include>
<include src="instant_confirm_overlay.js"></include>
-<if expr="pp_ifdef('enable_web_intents_tag')">
+<if expr="pp_ifdef('enable_web_intents')">
<include src="intents_list.js"></include>
<include src="intents_view.js"></include>
</if>
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 49b4e1b..ecfcaa5 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -2705,7 +2705,7 @@ void Browser::RegisterIntentHandlerHelper(WebContents* tab,
const string16& href,
const string16& title,
const string16& disposition) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents))
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
return;
TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents(
@@ -4051,7 +4051,7 @@ void Browser::RegisterIntentHandler(WebContents* tab,
void Browser::WebIntentDispatch(
WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents))
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
return;
TabContentsWrapper* tcw =
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc
index 5170e67..fabd1dc 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -284,8 +284,8 @@ void ContentSettingsHandler::GetLocalizedValues(
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableClickToPlay));
localized_strings->SetBoolean("enable_web_intents",
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebIntents));
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents));
}
void ContentSettingsHandler::Initialize() {
@@ -438,10 +438,10 @@ void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() {
void ContentSettingsHandler::UpdateExceptionsViewFromModel(
ContentSettingsType type) {
- // Update intents unless it's disabled from the command line.
+ // Skip updating intents unless it's enabled from the command line.
if (type == CONTENT_SETTINGS_TYPE_INTENTS &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebIntents))
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents))
return;
switch (type) {
diff --git a/chrome/browser/ui/webui/options2/content_settings_handler2.cc b/chrome/browser/ui/webui/options2/content_settings_handler2.cc
index ac59934..320cbd5 100644
--- a/chrome/browser/ui/webui/options2/content_settings_handler2.cc
+++ b/chrome/browser/ui/webui/options2/content_settings_handler2.cc
@@ -286,8 +286,8 @@ void ContentSettingsHandler::GetLocalizedValues(
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableClickToPlay));
localized_strings->SetBoolean("enable_web_intents",
- !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebIntents));
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents));
}
void ContentSettingsHandler::Initialize() {
@@ -440,10 +440,10 @@ void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() {
void ContentSettingsHandler::UpdateExceptionsViewFromModel(
ContentSettingsType type) {
- // Update intents unless it's disabled from the command line.
+ // Skip updating intents unless it's enabled from the command line.
if (type == CONTENT_SETTINGS_TYPE_INTENTS &&
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebIntents))
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents))
return;
switch (type) {
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc
index 95d231d..8dae526 100644
--- a/chrome/common/extensions/extension.cc
+++ b/chrome/common/extensions/extension.cc
@@ -1132,7 +1132,7 @@ bool Extension::LoadWebIntentServices(const extensions::Manifest* manifest,
string16* error) {
DCHECK(error);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents))
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
return true;
if (!manifest->HasKey(keys::kIntents))
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index 0cadcb7..696f64a 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -775,6 +775,8 @@ TEST_F(ExtensionManifestTest, TtsEngine) {
}
TEST_F(ExtensionManifestTest, WebIntents) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableWebIntents);
+
LoadAndExpectError("intent_invalid_1.json",
extension_manifest_errors::kInvalidIntents);
LoadAndExpectError("intent_invalid_2.json",
@@ -820,6 +822,8 @@ TEST_F(ExtensionManifestTest, WebIntents) {
}
TEST_F(ExtensionManifestTest, WebIntentsWithMultipleMimeTypes) {
+ CommandLine::ForCurrentProcess()->AppendSwitch(switches::kEnableWebIntents);
+
scoped_refptr<Extension> extension(
LoadAndExpectSuccess("intent_valid_multitype.json"));
ASSERT_TRUE(extension.get() != NULL);
diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc
index f61afca..65daff0 100644
--- a/content/browser/intents/intent_injector.cc
+++ b/content/browser/intents/intent_injector.cc
@@ -66,8 +66,8 @@ void IntentInjector::DidNavigateMainFrame(
// like it might be racy, though.
void IntentInjector::SendIntent() {
if (source_intent_.get() == NULL ||
- CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kDisableWebIntents) ||
+ !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableWebIntents) ||
web_contents()->GetRenderViewHost() == NULL) {
return;
}
@@ -90,7 +90,7 @@ bool IntentInjector::OnMessageReceived(const IPC::Message& message) {
void IntentInjector::OnReply(webkit_glue::WebIntentReplyType reply_type,
const string16& data) {
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents))
+ if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
NOTREACHED();
if (intents_dispatcher_) {
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index b52ff9f..d8d66af 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -285,7 +285,7 @@ const char kEnableVideoFullscreen[] = "enable-video-fullscreen";
const char kEnableVideoTrack[] = "enable-video-track";
// Enable Web Intents.
-const char kDisableWebIntents[] = "disable-web-intents";
+const char kEnableWebIntents[] = "enable-web-intents";
// Enables experimental features for the geolocation API.
// Current features:
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index bb3077e..f1afadc 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -95,7 +95,7 @@ CONTENT_EXPORT extern const char kEnableTcpFastOpen[];
CONTENT_EXPORT extern const char kEnableTouchEvents[];
extern const char kEnableVideoFullscreen[];
CONTENT_EXPORT extern const char kEnableVideoTrack[];
-CONTENT_EXPORT extern const char kDisableWebIntents[];
+CONTENT_EXPORT extern const char kEnableWebIntents[];
CONTENT_EXPORT extern const char kExperimentalLocationFeatures[];
extern const char kExtraPluginDir[];
extern const char kForceFieldTestNameAndValue[];