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

Side by Side Diff: chrome/browser/content_settings/content_settings_provider.h

Issue 8539004: Replace SetContentSetting method of the content_settings::Provider interface with GetWebsiteSetting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 1 month 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Interface for objects providing content setting rules. 5 // Interface for objects providing content setting rules.
6 6
7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ 7 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ 8 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
9 #pragma once 9 #pragma once
10 10
(...skipping 25 matching lines...) Expand all
36 // normal mode. Otherwise, it returns the content settings for the normal 36 // normal mode. Otherwise, it returns the content settings for the normal
37 // mode. The caller takes the ownership of the returned |RuleIterator|. It is 37 // mode. The caller takes the ownership of the returned |RuleIterator|. It is
38 // not allowed to call other |ProviderInterface| functions (including 38 // not allowed to call other |ProviderInterface| functions (including
39 // |GetRuleIterator|) for the same provider until the |RuleIterator| is 39 // |GetRuleIterator|) for the same provider until the |RuleIterator| is
40 // destroyed. 40 // destroyed.
41 virtual RuleIterator* GetRuleIterator( 41 virtual RuleIterator* GetRuleIterator(
42 ContentSettingsType content_type, 42 ContentSettingsType content_type,
43 const ResourceIdentifier& resource_identifier, 43 const ResourceIdentifier& resource_identifier,
44 bool incognito) const = 0; 44 bool incognito) const = 0;
45 45
46 // Sets the content setting for a particular |primary_pattern|, 46 // Sets the website setting for a particular |primary_pattern|,
47 // |secondary_pattern|, |content_type| tuple. For ContentSettingsTypes that 47 // |secondary_pattern|, |content_type| tuple. For ContentSettingsTypes that
48 // require a resource identifier to be specified, the |resource_identifier| 48 // require a resource identifier to be specified, the |resource_identifier|
49 // must be non-empty. 49 // must be non-empty. The ownership of the passed |value| remains with the
50 // caller. Provider copy the passed |value|.
Bernhard Bauer 2011/11/11 14:00:40 The last sentence is unnecessary (what the provide
markusheintz_ 2011/11/14 11:15:10 Done.
50 // 51 //
51 // This should only be called on the UI thread, and not after 52 // This should only be called on the UI thread, and not after
52 // ShutdownOnUIThread has been called. 53 // ShutdownOnUIThread has been called.
53 virtual void SetContentSetting( 54 virtual void SetWebsiteSetting(
54 const ContentSettingsPattern& primary_pattern, 55 const ContentSettingsPattern& primary_pattern,
55 const ContentSettingsPattern& secondary_pattern, 56 const ContentSettingsPattern& secondary_pattern,
56 ContentSettingsType content_type, 57 ContentSettingsType content_type,
57 const ResourceIdentifier& resource_identifier, 58 const ResourceIdentifier& resource_identifier,
58 ContentSetting content_setting) = 0; 59 const Value* value) = 0;
59 60
60 // Resets all content settings for the given |content_type| and empty resource 61 // Resets all content settings for the given |content_type| and empty resource
61 // identifier to CONTENT_SETTING_DEFAULT. 62 // identifier to CONTENT_SETTING_DEFAULT.
62 // 63 //
63 // This should only be called on the UI thread, and not after 64 // This should only be called on the UI thread, and not after
64 // ShutdownOnUIThread has been called. 65 // ShutdownOnUIThread has been called.
65 virtual void ClearAllContentSettingsRules( 66 virtual void ClearAllContentSettingsRules(
66 ContentSettingsType content_type) = 0; 67 ContentSettingsType content_type) = 0;
67 68
68 // Detaches the Provider from all Profile-related objects like PrefService. 69 // Detaches the Provider from all Profile-related objects like PrefService.
69 // This methods needs to be called before destroying the Profile. 70 // This methods needs to be called before destroying the Profile.
70 // Afterwards, none of the methods above that should only be called on the UI 71 // Afterwards, none of the methods above that should only be called on the UI
71 // thread should be called anymore. 72 // thread should be called anymore.
72 virtual void ShutdownOnUIThread() = 0; 73 virtual void ShutdownOnUIThread() = 0;
73 }; 74 };
74 75
75 } // namespace content_settings 76 } // namespace content_settings
76 77
77 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_ 78 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698