| OLD | NEW |
| (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: |
| 20 ContentSettingsRule( |
| 21 const HostPattern& host_pattern, |
| 22 const ContentSetting& setting) : |
| 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; |
| 52 |
| 53 } // namespace content_settings |
| 54 |
| 55 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_ |
| OLD | NEW |