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

Unified Diff: chrome/browser/content_settings/host_pattern.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/host_pattern.h
diff --git a/chrome/browser/content_settings/host_pattern.h b/chrome/browser/content_settings/host_pattern.h
new file mode 100644
index 0000000000000000000000000000000000000000..0838a600a3af4deaf81490bfb969890249cfb0a9
--- /dev/null
+++ b/chrome/browser/content_settings/host_pattern.h
@@ -0,0 +1,42 @@
+// 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_HOST_PATTERN_H_
+#define CHROME_BROWSER_CONTENT_SETTINGS_HOST_PATTERN_H_
+#pragma once
+
+#include "chrome/browser/content_settings/content_settings_pattern.h"
+#include "chrome/browser/content_settings/host.h"
+
+namespace content_settings {
+
+class HostPattern {
+ public:
+ HostPattern(const ContentSettingsPattern& requesting_url_pattern,
+ const ContentSettingsPattern& embedding_url_pattern) :
Bernhard Bauer 2011/01/26 10:25:18 Nit: fix indentation and put the colon on the foll
markusheintz_ 2011/01/26 15:27:08 Will fix if we keep the class.
+ requesting_url_pattern_(requesting_url_pattern),
+ embedding_url_pattern_(embedding_url_pattern) {}
+
+ // Return true if the HostPattern matches the given |source|.
+ bool Matches(const Host& host) const {
+ return requesting_url_pattern_.Matches(host.requesting_url()) &&
+ embedding_url_pattern_.Matches(host.embedding_url());
+ }
+
+ const ContentSettingsPattern& requesting_url_pattern() {
+ return requesting_url_pattern_;
+ }
+
+ const ContentSettingsPattern& embedding_url_pattern() {
+ return embedding_url_pattern_;
+ }
+
+ private:
+ const ContentSettingsPattern requesting_url_pattern_;
+ const ContentSettingsPattern embedding_url_pattern_;
+};
+
+} // namespace content_Settings
+
+#endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_PATTERN_H_

Powered by Google App Engine
This is Rietveld 408576698