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

Unified 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 side-by-side diff with in-line comments
Download patch
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:
+ ContentSettingsRule(
+ const HostPattern& host_pattern,
+ const ContentSetting& setting) :
+ 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;
+
+} // namespace content_settings
+
+#endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_RULE_H_

Powered by Google App Engine
This is Rietveld 408576698