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

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

Issue 6350010: Put some plug-ins behind an infobar, where they have:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/host_content_settings_map.h" 5 #include "chrome/browser/content_settings/host_content_settings_map.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_thread.h" 10 #include "chrome/browser/browser_thread.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 ContentSettings output = GetNonDefaultContentSettings(url); 286 ContentSettings output = GetNonDefaultContentSettings(url);
287 287
288 // If we require a resource identifier, set the content settings to default, 288 // If we require a resource identifier, set the content settings to default,
289 // otherwise make the defaults explicit. 289 // otherwise make the defaults explicit.
290 for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) { 290 for (int j = 0; j < CONTENT_SETTINGS_NUM_TYPES; ++j) {
291 if (RequiresResourceIdentifier(ContentSettingsType(j))) { 291 if (RequiresResourceIdentifier(ContentSettingsType(j))) {
292 output.settings[j] = CONTENT_SETTING_DEFAULT; 292 output.settings[j] = CONTENT_SETTING_DEFAULT;
293 } else { 293 } else {
294 // A managed default content setting has the highest priority and hence 294 // A managed default content setting has the highest priority and hence
295 // will overwrite any previously set value. 295 // will overwrite any previously set value.
296 if ((output.settings[j] == CONTENT_SETTING_DEFAULT) || 296 if ((output.settings[j] == CONTENT_SETTING_DEFAULT &&
297 j != CONTENT_SETTINGS_TYPE_PLUGINS) ||
297 IsDefaultContentSettingManaged(ContentSettingsType(j))) { 298 IsDefaultContentSettingManaged(ContentSettingsType(j))) {
298 output.settings[j] = GetDefaultContentSetting(ContentSettingsType(j)); 299 output.settings[j] = GetDefaultContentSetting(ContentSettingsType(j));
299 } 300 }
300 } 301 }
301 } 302 }
302 return output; 303 return output;
303 } 304 }
304 305
305 ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings( 306 ContentSettings HostContentSettingsMap::GetNonDefaultContentSettings(
306 const GURL& url) const { 307 const GURL& url) const {
(...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after
968 } 969 }
969 970
970 for (size_t i = 0; i < move_items.size(); ++i) { 971 for (size_t i = 0; i < move_items.size(); ++i) {
971 Value* pattern_settings_dictionary = NULL; 972 Value* pattern_settings_dictionary = NULL;
972 all_settings_dictionary->RemoveWithoutPathExpansion( 973 all_settings_dictionary->RemoveWithoutPathExpansion(
973 move_items[i].first, &pattern_settings_dictionary); 974 move_items[i].first, &pattern_settings_dictionary);
974 all_settings_dictionary->SetWithoutPathExpansion( 975 all_settings_dictionary->SetWithoutPathExpansion(
975 move_items[i].second, pattern_settings_dictionary); 976 move_items[i].second, pattern_settings_dictionary);
976 } 977 }
977 } 978 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698