diff options
author | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-01 22:36:02 +0000 |
---|---|---|
committer | gbillock@chromium.org <gbillock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-03-01 22:36:02 +0000 |
commit | 3385da4ec792b510a337b52d8b08e5eabb0341cd (patch) | |
tree | bb98e4f10ca3abb1399453ca82e43b17646262a6 | |
parent | 001ede4f1bfb1d687ebf2078132aca530faa6e8f (diff) | |
download | chromium_src-3385da4ec792b510a337b52d8b08e5eabb0341cd.zip chromium_src-3385da4ec792b510a337b52d8b08e5eabb0341cd.tar.gz chromium_src-3385da4ec792b510a337b52d8b08e5eabb0341cd.tar.bz2 |
Revert 119423 - Revert 119306 - Turn web intents build flag on.
Move the command-line flag to default-on.
(Revert of 119284 : https://chromiumcodereview.appspot.com/9212036)
IN CASE OF FIRE, PULL THIS HANDLE! If web intents needs
to be disabled, revert this change.
R=jhawkins@chromium.org
BUG=111135
TEST=None
Review URL: http://codereview.chromium.org/9271084
TBR=gbillock@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9564032
git-svn-id: svn://svn.chromium.org/chrome/branches/1025/src@124505 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | build/common.gypi | 14 | ||||
-rw-r--r-- | chrome/browser/content_settings/host_content_settings_map.cc | 5 | ||||
-rw-r--r-- | chrome/browser/resources/options/options.html | 4 | ||||
-rw-r--r-- | chrome/browser/resources/options/options_bundle.js | 2 | ||||
-rw-r--r-- | chrome/browser/resources/options2/content_settings.html | 2 | ||||
-rw-r--r-- | chrome/browser/resources/options2/options.html | 4 | ||||
-rw-r--r-- | chrome/browser/resources/options2/options_bundle.js | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options/content_settings_handler.cc | 13 | ||||
-rw-r--r-- | chrome/browser/ui/webui/options2/content_settings_handler2.cc | 13 | ||||
-rw-r--r-- | chrome/common/extensions/extension_manifests_unittest.cc | 26 | ||||
-rw-r--r-- | content/browser/intents/intent_injector.cc | 8 | ||||
-rw-r--r-- | content/public/common/content_switches.cc | 2 | ||||
-rw-r--r-- | content/public/common/content_switches.h | 2 |
14 files changed, 40 insertions, 61 deletions
diff --git a/build/common.gypi b/build/common.gypi index f8a45ec..86bbba7 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -207,13 +207,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, @@ -432,7 +427,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 @@ -907,8 +901,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 7a00e90..c03fc8f 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -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 e99ad52..1a332ed 100644 --- a/chrome/browser/resources/options2/options.html +++ b/chrome/browser/resources/options2/options.html @@ -29,7 +29,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"> @@ -172,7 +172,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 97a6c2b..4733c5f 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -2704,7 +2704,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( @@ -4044,7 +4044,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 5ce2729..d1de2d55 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -281,8 +281,8 @@ void ContentSettingsHandler::GetLocalizedValues( RegisterTitle(localized_strings, "contentSettingsPage", IDS_CONTENT_SETTINGS_TITLE); localized_strings->SetBoolean("enable_web_intents", - !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableWebIntents)); + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebIntents)); } void ContentSettingsHandler::Initialize() { @@ -435,9 +435,10 @@ void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { void ContentSettingsHandler::UpdateExceptionsViewFromModel( ContentSettingsType type) { - // Don't update intents settings at this point. - // Turn on when enable_web_intents_tag is enabled. - if (type == CONTENT_SETTINGS_TYPE_INTENTS) + // Skip updating intents unless it's enabled from the command line. + if (type == CONTENT_SETTINGS_TYPE_INTENTS && + !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 511f1f5..8b58dee 100644 --- a/chrome/browser/ui/webui/options2/content_settings_handler2.cc +++ b/chrome/browser/ui/webui/options2/content_settings_handler2.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -283,8 +283,8 @@ void ContentSettingsHandler::GetLocalizedValues( RegisterTitle(localized_strings, "contentSettingsPage", IDS_CONTENT_SETTINGS_TITLE); localized_strings->SetBoolean("enable_web_intents", - !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableWebIntents)); + CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebIntents)); } void ContentSettingsHandler::Initialize() { @@ -437,9 +437,10 @@ void ContentSettingsHandler::UpdateAllOTRExceptionsViewsFromModel() { void ContentSettingsHandler::UpdateExceptionsViewFromModel( ContentSettingsType type) { - // Don't update intents settings at this point. - // Turn on when enable_web_intents_tag is enabled. - if (type == CONTENT_SETTINGS_TYPE_INTENTS) + // Skip updating intents unless it's enabled from the command line. + if (type == CONTENT_SETTINGS_TYPE_INTENTS && + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebIntents)) return; switch (type) { diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc index 3e8143e..77416e6 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); + Testcase testcases[] = { {"intent_invalid_1.json", errors::kInvalidIntents}, {"intent_invalid_2.json", errors::kInvalidIntent}, @@ -818,6 +820,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); @@ -845,28 +849,6 @@ TEST_F(ExtensionManifestTest, WebIntentsWithMultipleMimeTypes) { extension_manifest_errors::kInvalidIntentTypeElement); } -TEST_F(ExtensionManifestTest,WebIntentsInHostedApps) { - LoadAndExpectError("intent_invalid_hosted_app_1.json", - errors::kInvalidIntentPageInHostedApp); - LoadAndExpectError("intent_invalid_hosted_app_2.json", - errors::kInvalidIntentPageInHostedApp); - LoadAndExpectError("intent_invalid_hosted_app_3.json", - errors::kInvalidIntentPageInHostedApp); - - scoped_refptr<Extension> extension( - LoadAndExpectSuccess("intent_valid_hosted_app.json")); - ASSERT_TRUE(extension.get() != NULL); - - ASSERT_EQ(3u, extension->intents_services().size()); - - EXPECT_EQ("http://www.cfp.com/intents/edit.html", - extension->intents_services()[0].service_url.spec()); - EXPECT_EQ("http://www.cloudfilepicker.com/", - extension->intents_services()[1].service_url.spec()); - EXPECT_EQ("http://www.cloudfilepicker.com/intents/share.html", - extension->intents_services()[2].service_url.spec()); -} - TEST_F(ExtensionManifestTest, PortsInPermissions) { // Loading as a user would shoud not trigger an error. LoadAndExpectSuccess("ports_in_permissions.json"); diff --git a/content/browser/intents/intent_injector.cc b/content/browser/intents/intent_injector.cc index 0b7f894..9b05d29 100644 --- a/content/browser/intents/intent_injector.cc +++ b/content/browser/intents/intent_injector.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -56,8 +56,8 @@ void IntentInjector::OnSendReturnMessage( void IntentInjector::RenderViewCreated(RenderViewHost* render_view_host) { if (source_intent_.get() == NULL || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kDisableWebIntents) || + !CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableWebIntents) || web_contents()->GetRenderViewHost() == NULL) { return; } @@ -77,7 +77,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 9d20c2c..61479c3 100644 --- a/content/public/common/content_switches.cc +++ b/content/public/common/content_switches.cc @@ -291,7 +291,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 90e1082..dce43e5 100644 --- a/content/public/common/content_switches.h +++ b/content/public/common/content_switches.h @@ -97,7 +97,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[]; |