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

Side by Side Diff: chrome/browser/content_settings/content_settings_rule.h

Issue 6253012: Add ContentSettingsProvider Interface. (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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_
7 #pragma once
8
9 #include <vector>
10
11 #include "base/linked_ptr.h"
12 #include "chrome/browser/content_settings/host.h"
13 #include "chrome/browser/content_settings/host_pattern.h"
14 #include "chrome/common/content_settings.h"
15
16 namespace content_settings {
17
18 class ContentSettingsRule {
19 public:
jochen (gone - plz use gerrit) 2011/01/26 11:29:18 this should be std::pair<>
markusheintz_ 2011/01/26 15:27:08 Will not work if we keep the embedder URL.
20 ContentSettingsRule(
21 const HostPattern& host_pattern,
22 const ContentSetting& setting) :
Bernhard Bauer 2011/01/26 10:25:18 Nit: colon on the following line.
markusheintz_ 2011/01/26 15:27:08 Will fix if we keep the class
23 host_pattern_(host_pattern),
24 content_setting_(setting) {}
25
26 const HostPattern& host_pattern() const {
27 return host_pattern_;
28 }
29
30 const ContentSetting& content_setting() const {
31 return content_setting_;
32 }
33
34 // Compare two rules. If the rules are not disjunct, i.e. if there is a Host
35 // matching both rules, the rule taking precedence should be the smaller one.
36 // Otherwise, any ordering may be returned, as long as it follows the rules
37 // for the < operator (like lexically comparing the |host_pattern_|.
38 bool operator<(const ContentSettingsRule& other) const {
39 // TODO(markusheintz): Implement
40 return false;
41 }
42
43 private:
44 const HostPattern host_pattern_;
45 const ContentSetting content_setting_;
46
47 DISALLOW_COPY_AND_ASSIGN(ContentSettingsRule);
48 };
49
50 typedef linked_ptr<ContentSettingsRule> ContentSettingsRulePtr;
51 typedef std::vector<ContentSettingsRulePtr> ContentSettingsRules;
Bernhard Bauer 2011/01/26 10:25:18 Nit: I think we usually have typedef's before clas
markusheintz_ 2011/01/26 15:27:08 Will fix if we keep the class
52
53 } // namespace content_settings
54
55 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698