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

Side by Side Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

Issue 1372353004: Making structure for ContentSettings and its corresponding strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes as per review comments. Created 5 years, 2 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
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/extensions/api/content_settings/content_settings_store. h" 5 #include "chrome/browser/extensions/api/content_settings/content_settings_store. h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/debug/alias.h" 9 #include "base/debug/alias.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 rule.secondary_pattern.ToString()); 266 rule.secondary_pattern.ToString());
267 setting_dict->SetString( 267 setting_dict->SetString(
268 keys::kContentSettingsTypeKey, 268 keys::kContentSettingsTypeKey,
269 helpers::ContentSettingsTypeToString(it->first.content_type)); 269 helpers::ContentSettingsTypeToString(it->first.content_type));
270 setting_dict->SetString(keys::kResourceIdentifierKey, 270 setting_dict->SetString(keys::kResourceIdentifierKey,
271 it->first.resource_identifier); 271 it->first.resource_identifier);
272 ContentSetting content_setting = ValueToContentSetting(rule.value.get()); 272 ContentSetting content_setting = ValueToContentSetting(rule.value.get());
273 DCHECK_NE(CONTENT_SETTING_DEFAULT, content_setting); 273 DCHECK_NE(CONTENT_SETTING_DEFAULT, content_setting);
274 setting_dict->SetString( 274 setting_dict->SetString(
275 keys::kContentSettingKey, 275 keys::kContentSettingKey,
276 helpers::ContentSettingToString(content_setting)); 276 content_settings::ContentSettingToString(content_setting));
277 settings->Append(setting_dict); 277 settings->Append(setting_dict);
278 } 278 }
279 } 279 }
280 return settings; 280 return settings;
281 } 281 }
282 282
283 void ContentSettingsStore::SetExtensionContentSettingFromList( 283 void ContentSettingsStore::SetExtensionContentSettingFromList(
284 const std::string& extension_id, 284 const std::string& extension_id,
285 const base::ListValue* list, 285 const base::ListValue* list,
286 ExtensionPrefsScope scope) { 286 ExtensionPrefsScope scope) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 ContentSettingsStore::FindEntry(const std::string& ext_id) const { 368 ContentSettingsStore::FindEntry(const std::string& ext_id) const {
369 ExtensionEntryMap::const_iterator i; 369 ExtensionEntryMap::const_iterator i;
370 for (i = entries_.begin(); i != entries_.end(); ++i) { 370 for (i = entries_.begin(); i != entries_.end(); ++i) {
371 if (i->second->id == ext_id) 371 if (i->second->id == ext_id)
372 return i; 372 return i;
373 } 373 }
374 return entries_.end(); 374 return entries_.end();
375 } 375 }
376 376
377 } // namespace extensions 377 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698