Chromium Code Reviews| Index: chrome/browser/content_settings/content_settings_rule.h |
| diff --git a/chrome/browser/content_settings/content_settings_rule.h b/chrome/browser/content_settings/content_settings_rule.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7e4afc297b70b6e0cbdc4662fc9e567b0a660ec3 |
| --- /dev/null |
| +++ b/chrome/browser/content_settings/content_settings_rule.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_ |
| +#define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_ |
| +#pragma once |
| + |
| +#include <vector> |
| + |
| +#include "base/linked_ptr.h" |
| +#include "chrome/browser/content_settings/host.h" |
| +#include "chrome/browser/content_settings/host_pattern.h" |
| +#include "chrome/common/content_settings.h" |
| + |
| +namespace content_settings { |
| + |
| +class ContentSettingsRule { |
| + 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.
|
| + ContentSettingsRule( |
| + const HostPattern& host_pattern, |
| + 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
|
| + host_pattern_(host_pattern), |
| + content_setting_(setting) {} |
| + |
| + const HostPattern& host_pattern() const { |
| + return host_pattern_; |
| + } |
| + |
| + const ContentSetting& content_setting() const { |
| + return content_setting_; |
| + } |
| + |
| + // Compare two rules. If the rules are not disjunct, i.e. if there is a Host |
| + // matching both rules, the rule taking precedence should be the smaller one. |
| + // Otherwise, any ordering may be returned, as long as it follows the rules |
| + // for the < operator (like lexically comparing the |host_pattern_|. |
| + bool operator<(const ContentSettingsRule& other) const { |
| + // TODO(markusheintz): Implement |
| + return false; |
| + } |
| + |
| + private: |
| + const HostPattern host_pattern_; |
| + const ContentSetting content_setting_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ContentSettingsRule); |
| +}; |
| + |
| +typedef linked_ptr<ContentSettingsRule> ContentSettingsRulePtr; |
| +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
|
| + |
| +} // namespace content_settings |
| + |
| +#endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_ |