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

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

Issue 648653003: Standardize usage of virtual/override/final in chrome/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ 6 #define CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h" 11 #include "components/content_settings/core/browser/content_settings_observable_p rovider.h"
12 #include "components/content_settings/core/browser/content_settings_origin_ident ifier_value_map.h" 12 #include "components/content_settings/core/browser/content_settings_origin_ident ifier_value_map.h"
13 #include "components/content_settings/core/common/content_settings_pattern.h" 13 #include "components/content_settings/core/common/content_settings_pattern.h"
14 #include "components/content_settings/core/common/content_settings_types.h" 14 #include "components/content_settings/core/common/content_settings_types.h"
15 15
16 namespace content_settings { 16 namespace content_settings {
17 17
18 // The class MockProvider is a mock for a non default content settings provider. 18 // The class MockProvider is a mock for a non default content settings provider.
19 class MockProvider : public ObservableProvider { 19 class MockProvider : public ObservableProvider {
20 public: 20 public:
21 MockProvider(); 21 MockProvider();
22 explicit MockProvider(bool read_only); 22 explicit MockProvider(bool read_only);
23 virtual ~MockProvider(); 23 ~MockProvider() override;
24 24
25 virtual RuleIterator* GetRuleIterator( 25 RuleIterator* GetRuleIterator(ContentSettingsType content_type,
26 ContentSettingsType content_type, 26 const ResourceIdentifier& resource_identifier,
27 const ResourceIdentifier& resource_identifier, 27 bool incognito) const override;
28 bool incognito) const override;
29 28
30 // The MockProvider is only able to store one content setting. So every time 29 // The MockProvider is only able to store one content setting. So every time
31 // this method is called the previously set content settings is overwritten. 30 // this method is called the previously set content settings is overwritten.
32 virtual bool SetWebsiteSetting( 31 bool SetWebsiteSetting(const ContentSettingsPattern& requesting_url_pattern,
33 const ContentSettingsPattern& requesting_url_pattern, 32 const ContentSettingsPattern& embedding_url_pattern,
34 const ContentSettingsPattern& embedding_url_pattern, 33 ContentSettingsType content_type,
35 ContentSettingsType content_type, 34 const ResourceIdentifier& resource_identifier,
36 const ResourceIdentifier& resource_identifier, 35 base::Value* value) override;
37 base::Value* value) override;
38 36
39 virtual void ClearAllContentSettingsRules( 37 void ClearAllContentSettingsRules(ContentSettingsType content_type) override {
40 ContentSettingsType content_type) override {} 38 }
41 39
42 virtual void ShutdownOnUIThread() override; 40 void ShutdownOnUIThread() override;
43 41
44 void set_read_only(bool read_only) { 42 void set_read_only(bool read_only) {
45 read_only_ = read_only; 43 read_only_ = read_only;
46 } 44 }
47 45
48 bool read_only() const { 46 bool read_only() const {
49 return read_only_; 47 return read_only_;
50 } 48 }
51 49
52 private: 50 private:
53 OriginIdentifierValueMap value_map_; 51 OriginIdentifierValueMap value_map_;
54 bool read_only_; 52 bool read_only_;
55 53
56 DISALLOW_COPY_AND_ASSIGN(MockProvider); 54 DISALLOW_COPY_AND_ASSIGN(MockProvider);
57 }; 55 };
58 56
59 } // namespace content_settings 57 } // namespace content_settings
60 58
61 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_ 59 #endif // CHROME_BROWSER_CONTENT_SETTINGS_CONTENT_SETTINGS_MOCK_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698