Chromium Code Reviews| 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_ |