diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 17:38:50 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-31 17:38:50 +0000 |
commit | 7c1301cb022beff506e729fda3821ca6e4497000 (patch) | |
tree | ba3e38ba8b8b18b0d03f5e72fd9aba347ee0cb95 | |
parent | 29c8883a0341bf4e356d7ee5a29fe3942d849500 (diff) | |
download | chromium_src-7c1301cb022beff506e729fda3821ca6e4497000.zip chromium_src-7c1301cb022beff506e729fda3821ca6e4497000.tar.gz chromium_src-7c1301cb022beff506e729fda3821ca6e4497000.tar.bz2 |
Merge 119773 - Move click-to-play out of chrome://flags.
This makes the click-to-play feature available in content settings without having to enable it in chrome://flags.
Original review: http://codereview.chromium.org/9293008
BUG=62084
TEST=none
Review URL: https://chromiumcodereview.appspot.com/9293010
git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@119911 0039d316-1c4b-4281-b951-d872f2087c98
15 files changed, 9 insertions, 77 deletions
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 73695be..43e0849 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc @@ -226,13 +226,6 @@ const Experiment kExperiments[] = { SINGLE_VALUE_TYPE(switches::kAppsNewInstallBubble) }, { - "click-to-play", // FLAGS:RECORD_UMA - IDS_FLAGS_CLICK_TO_PLAY_NAME, - IDS_FLAGS_CLICK_TO_PLAY_DESCRIPTION, - kOsAll, - SINGLE_VALUE_TYPE(switches::kEnableClickToPlay) - }, - { "disable-hyperlink-auditing", IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_NAME, IDS_FLAGS_DISABLE_HYPERLINK_AUDITING_DESCRIPTION, diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc index 3061658..c83d730 100644 --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -631,7 +631,7 @@ void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( switches::kDisablePrintPreview, switches::kDomAutomationController, switches::kDumpHistogramsOnExit, - switches::kEnableClickToPlay, + switches::kEnableBenchmarking, switches::kEnableCrxlessWebApps, switches::kEnableExperimentalExtensionApis, switches::kEnableInBrowserThumbnailing, diff --git a/chrome/browser/content_settings/content_settings_default_provider.cc b/chrome/browser/content_settings/content_settings_default_provider.cc index c9987a0..13f6096 100644 --- a/chrome/browser/content_settings/content_settings_default_provider.cc +++ b/chrome/browser/content_settings/content_settings_default_provider.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -349,15 +349,6 @@ void DefaultProvider::GetSettingsFromDictionary( default_settings_[CONTENT_SETTINGS_TYPE_COOKIES].reset( Value::CreateIntegerValue(CONTENT_SETTING_BLOCK)); } - - if (default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()) { - ContentSetting plugin_setting = ValueToContentSetting( - default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].get()); - plugin_setting = - ClickToPlayFixup(CONTENT_SETTINGS_TYPE_PLUGINS, plugin_setting); - default_settings_[CONTENT_SETTINGS_TYPE_PLUGINS].reset( - Value::CreateIntegerValue(plugin_setting)); - } } void DefaultProvider::MigrateObsoleteNotificationPref() { diff --git a/chrome/browser/content_settings/content_settings_pref_provider.cc b/chrome/browser/content_settings/content_settings_pref_provider.cc index 93f5aed..f2d5405 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -420,8 +420,6 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) { found = resource_dictionary->GetIntegerWithoutPathExpansion( resource_identifier, &setting); DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); - setting = ClickToPlayFixup(content_type, - ContentSetting(setting)); value_map_.SetValue(pattern_pair.first, pattern_pair.second, content_type, @@ -436,8 +434,6 @@ void PrefProvider::ReadContentSettingsFromPref(bool overwrite) { DCHECK_NE(CONTENT_SETTING_DEFAULT, setting); setting = FixObsoleteCookiePromptMode(content_type, ContentSetting(setting)); - setting = ClickToPlayFixup(content_type, - ContentSetting(setting)); value_map_.SetValue(pattern_pair.first, pattern_pair.second, content_type, @@ -743,7 +739,6 @@ void PrefProvider::MigrateObsoletePerhostPref() { ContentSetting setting = IntToContentSetting(setting_int_value); setting = FixObsoleteCookiePromptMode(content_type, setting); - setting = ClickToPlayFixup(content_type, setting); if (setting != CONTENT_SETTING_DEFAULT) { SetWebsiteSetting( diff --git a/chrome/browser/content_settings/content_settings_utils.cc b/chrome/browser/content_settings/content_settings_utils.cc index de814d9..c877286 100644 --- a/chrome/browser/content_settings/content_settings_utils.cc +++ b/chrome/browser/content_settings/content_settings_utils.cc @@ -49,21 +49,6 @@ std::string GetTypeName(ContentSettingsType type) { return std::string(kTypeNames[type]); } -bool SupportsResourceIdentifier(ContentSettingsType content_type) { - return content_type == CONTENT_SETTINGS_TYPE_PLUGINS; -} - -ContentSetting ClickToPlayFixup(ContentSettingsType content_type, - ContentSetting setting) { - if (setting == CONTENT_SETTING_ASK && - content_type == CONTENT_SETTINGS_TYPE_PLUGINS && - !CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableClickToPlay)) { - return CONTENT_SETTING_BLOCK; - } - return setting; -} - std::string CreatePatternString( const ContentSettingsPattern& item_pattern, const ContentSettingsPattern& top_level_frame_pattern) { diff --git a/chrome/browser/content_settings/content_settings_utils.h b/chrome/browser/content_settings/content_settings_utils.h index 4b0e81b..0d597d7 100644 --- a/chrome/browser/content_settings/content_settings_utils.h +++ b/chrome/browser/content_settings/content_settings_utils.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -28,15 +28,6 @@ typedef std::pair<ContentSettingsPattern, ContentSettingsPattern> PatternPair; std::string GetTypeName(ContentSettingsType type); -// Returns true if the |content_type| supports a resource identifier. -// Resource identifiers are supported (but not required) for plug-ins. -bool SupportsResourceIdentifier(ContentSettingsType content_type); - -// Maps CONTENT_SETTING_ASK for the CONTENT_SETTINGS_TYPE_PLUGINS to -// CONTENT_SETTING_BLOCK if click-to-play is not enabled. -ContentSetting ClickToPlayFixup(ContentSettingsType content_type, - ContentSetting setting); - // Converts |Value| to |ContentSetting|. ContentSetting ValueToContentSetting(const base::Value* value); diff --git a/chrome/browser/content_settings/host_content_settings_map.cc b/chrome/browser/content_settings/host_content_settings_map.cc index 82815fc..b681b1c 100644 --- a/chrome/browser/content_settings/host_content_settings_map.cc +++ b/chrome/browser/content_settings/host_content_settings_map.cc @@ -326,9 +326,6 @@ bool HostContentSettingsMap::IsSettingAllowedForType( case CONTENT_SETTINGS_TYPE_COOKIES: return setting == CONTENT_SETTING_SESSION_ONLY; case CONTENT_SETTINGS_TYPE_PLUGINS: - return setting == CONTENT_SETTING_ASK && - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableClickToPlay); case CONTENT_SETTINGS_TYPE_GEOLOCATION: case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: case CONTENT_SETTINGS_TYPE_INTENTS: diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index 001d21d..51e923e 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -57,11 +57,6 @@ TEST_F(HostContentSettingsMapTest, DefaultValues) { CONTENT_SETTINGS_TYPE_IMAGES, std::string())); { - // Click-to-play needs to be enabled to set the content setting to ASK. - CommandLine* cmd = CommandLine::ForCurrentProcess(); - AutoReset<CommandLine> auto_reset(cmd, *cmd); - cmd->AppendSwitch(switches::kEnableClickToPlay); - host_content_settings_map->SetDefaultContentSetting( CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTING_ASK); EXPECT_EQ(CONTENT_SETTING_ASK, diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index b5990bb..ea31039 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -431,9 +431,6 @@ class PrerenderBrowserTest : public InProcessBrowserTest { virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { command_line->AppendSwitchASCII(switches::kPrerenderMode, switches::kPrerenderModeSwitchValueEnabled); - // This is needed to enable click-to-play without triggering a DCHECK. - // It does not actually enable click-to-play. - command_line->AppendSwitchASCII(switches::kEnableClickToPlay, ""); #if defined(OS_MACOSX) // The plugins directory isn't read by default on the Mac, so it needs to be // explicitly registered. diff --git a/chrome/browser/resources/options/content_settings.js b/chrome/browser/resources/options/content_settings.js index 94faa90..00b48e3 100644 --- a/chrome/browser/resources/options/content_settings.js +++ b/chrome/browser/resources/options/content_settings.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -65,9 +65,6 @@ cr.define('options', function() { OptionsPage.navigateToPage('cookies'); }; - if (!templateData.enable_click_to_play) - $('click_to_play').hidden = true; - if (!templateData.enable_web_intents && $('intent-section')) $('intent-section').hidden = true; }, diff --git a/chrome/browser/resources/options/content_settings_exceptions_area.js b/chrome/browser/resources/options/content_settings_exceptions_area.js index 7adde68..192231f 100644 --- a/chrome/browser/resources/options/content_settings_exceptions_area.js +++ b/chrome/browser/resources/options/content_settings_exceptions_area.js @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -361,8 +361,7 @@ cr.define('options.contentSettings', function() { var exceptionList = this; // Whether the exceptions in this list allow an 'Ask every time' option. - this.enableAskOption = (this.contentType == 'plugins' && - templateData.enable_click_to_play); + this.enableAskOption = this.contentType == 'plugins'; this.autoExpands = true; this.reset(); diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc index 8945051..5fa44ed 100644 --- a/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc +++ b/chrome/browser/ui/content_settings/content_setting_bubble_model_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 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. @@ -107,7 +107,6 @@ TEST_F(ContentSettingBubbleModelTest, MultiplePlugins) { CommandLine* cmd = CommandLine::ForCurrentProcess(); AutoReset<CommandLine> auto_reset(cmd, *cmd); cmd->AppendSwitch(switches::kEnableResourceContentSettings); - cmd->AppendSwitch(switches::kEnableClickToPlay); HostContentSettingsMap* map = profile()->GetHostContentSettingsMap(); std::string fooPlugin = "foo"; diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc index 3260f5f..c27719a 100644 --- a/chrome/browser/ui/webui/options/content_settings_handler.cc +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc @@ -278,9 +278,6 @@ void ContentSettingsHandler::GetLocalizedValues( RegisterStrings(localized_strings, resources, arraysize(resources)); RegisterTitle(localized_strings, "contentSettingsPage", IDS_CONTENT_SETTINGS_TITLE); - localized_strings->SetBoolean("enable_click_to_play", - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableClickToPlay)); localized_strings->SetBoolean("enable_web_intents", CommandLine::ForCurrentProcess()->HasSwitch( switches::kEnableWebIntents)); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index b51f829..a3b817e 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -444,9 +444,6 @@ const char kEnableAutologin[] = "enable-autologin"; // there's a server endpoint deployed. const char kEnableClearServerData[] = "enable-clear-server-data"; -// Enables click-to-play for blocked plug-ins. -const char kEnableClickToPlay[] = "enable-click-to-play"; - // This applies only when the process type is "service". Enables the Cloud // Print Proxy component within the service process. const char kEnableCloudPrintProxy[] = "enable-cloud-print-proxy"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index 7d847a5..fa86043 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -129,7 +129,6 @@ extern const char kEnableAuthNegotiatePort[]; extern const char kEnableAutofillFeedback[]; extern const char kEnableAutologin[]; extern const char kEnableClearServerData[]; -extern const char kEnableClickToPlay[]; extern const char kEnableCloudPrintProxy[]; extern const char kEnableCompositeToTexture[]; extern const char kEnableConnectBackupJobs[]; |