Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Side by Side Diff: chrome/browser/content_settings/content_settings_utils.cc

Issue 9293008: Move click-to-play out of chrome://flags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/content_settings/content_settings_utils.h" 5 #include "chrome/browser/content_settings/content_settings_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 30 matching lines...) Expand all
41 const char kPatternSeparator[] = ","; 41 const char kPatternSeparator[] = ",";
42 42
43 } // namespace 43 } // namespace
44 44
45 namespace content_settings { 45 namespace content_settings {
46 46
47 std::string GetTypeName(ContentSettingsType type) { 47 std::string GetTypeName(ContentSettingsType type) {
48 return std::string(kTypeNames[type]); 48 return std::string(kTypeNames[type]);
49 } 49 }
50 50
51 ContentSetting ClickToPlayFixup(ContentSettingsType content_type,
52 ContentSetting setting) {
53 if (setting == CONTENT_SETTING_ASK &&
54 content_type == CONTENT_SETTINGS_TYPE_PLUGINS &&
55 !CommandLine::ForCurrentProcess()->HasSwitch(
56 switches::kEnableClickToPlay)) {
57 return CONTENT_SETTING_BLOCK;
58 }
59 return setting;
60 }
61
62 std::string CreatePatternString( 51 std::string CreatePatternString(
63 const ContentSettingsPattern& item_pattern, 52 const ContentSettingsPattern& item_pattern,
64 const ContentSettingsPattern& top_level_frame_pattern) { 53 const ContentSettingsPattern& top_level_frame_pattern) {
65 return item_pattern.ToString() 54 return item_pattern.ToString()
66 + std::string(kPatternSeparator) 55 + std::string(kPatternSeparator)
67 + top_level_frame_pattern.ToString(); 56 + top_level_frame_pattern.ToString();
68 } 57 }
69 58
70 PatternPair ParsePatternString(const std::string& pattern_str) { 59 PatternPair ParsePatternString(const std::string& pattern_str) {
71 std::vector<std::string> pattern_str_list; 60 std::vector<std::string> pattern_str_list;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 182
194 void GetRendererContentSettingRules(const HostContentSettingsMap* map, 183 void GetRendererContentSettingRules(const HostContentSettingsMap* map,
195 RendererContentSettingRules* rules) { 184 RendererContentSettingRules* rules) {
196 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "", 185 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_IMAGES, "",
197 &(rules->image_rules)); 186 &(rules->image_rules));
198 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "", 187 map->GetSettingsForOneType(CONTENT_SETTINGS_TYPE_JAVASCRIPT, "",
199 &(rules->script_rules)); 188 &(rules->script_rules));
200 } 189 }
201 190
202 } // namespace content_settings 191 } // namespace content_settings
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/content_settings_utils.h ('k') | chrome/browser/content_settings/host_content_settings_map.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698