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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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_HOST_PATTERN_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_HOST_PATTERN_H_
7 #pragma once
8
9 #include "chrome/browser/content_settings/content_settings_pattern.h"
10 #include "chrome/browser/content_settings/host.h"
11
12 namespace content_settings {
13
14 class HostPattern {
15 public:
16 HostPattern(const ContentSettingsPattern& requesting_url_pattern,
17 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.
18 requesting_url_pattern_(requesting_url_pattern),
19 embedding_url_pattern_(embedding_url_pattern) {}
20
21 // Return true if the HostPattern matches the given |source|.
22 bool Matches(const Host& host) const {
23 return requesting_url_pattern_.Matches(host.requesting_url()) &&
24 embedding_url_pattern_.Matches(host.embedding_url());
25 }
26
27 const ContentSettingsPattern& requesting_url_pattern() {
28 return requesting_url_pattern_;
29 }
30
31 const ContentSettingsPattern& embedding_url_pattern() {
32 return embedding_url_pattern_;
33 }
34
35 private:
36 const ContentSettingsPattern requesting_url_pattern_;
37 const ContentSettingsPattern embedding_url_pattern_;
38 };
39
40 } // namespace content_Settings
41
42 #endif // CHROME_BROWSER_CONTENT_SETTINGS_HOST_PATTERN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698