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

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

Issue 7831075: Delegating the "are images allowed" decision to renderer. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: More code review comments. Created 9 years, 3 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_provider.h" 5 #include "chrome/browser/content_settings/content_settings_provider.h"
6 6
7 namespace content_settings { 7 namespace content_settings {
8 8
9 ProviderInterface::Rule::Rule() 9 ProviderInterface::Rule::Rule()
10 : content_setting(CONTENT_SETTING_DEFAULT) { 10 : content_setting(CONTENT_SETTING_DEFAULT) {
11 } 11 }
12 12
13 ProviderInterface::Rule::Rule(const ContentSettingsPattern& primary_pattern, 13 ProviderInterface::Rule::Rule(const ContentSettingsPattern& primary_pattern,
14 const ContentSettingsPattern& secondary_pattern, 14 const ContentSettingsPattern& secondary_pattern,
15 ContentSetting setting) 15 ContentSetting setting)
16 : primary_pattern(primary_pattern), 16 : primary_pattern(primary_pattern),
17 secondary_pattern(secondary_pattern), 17 secondary_pattern(secondary_pattern),
18 content_setting(setting) { 18 content_setting(setting) {
19 } 19 }
20 20
21 // static
22 bool ProviderInterface::Rule::LexicographicalSort(
23 const ProviderInterface::Rule& a,
24 const ProviderInterface::Rule& b) {
25 if (a.primary_pattern.ToString() < b.primary_pattern.ToString())
26 return true;
27 if (b.primary_pattern.ToString() < a.primary_pattern.ToString())
28 return false;
29 return (a.secondary_pattern.ToString() < b.secondary_pattern.ToString());
30 }
31
32 // static
33 bool ProviderInterface::Rule::PatternPrecedenceSort(
34 const ProviderInterface::Rule& a,
35 const ProviderInterface::Rule& b) {
36 if (a.primary_pattern < b.primary_pattern)
37 return true;
38 if (b.primary_pattern < a.primary_pattern)
39 return false;
40 return (a.secondary_pattern < b.secondary_pattern);
41 }
42
21 } // namespace content_settings 43 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698