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

Side by Side Diff: extensions/browser/api/storage/settings_test_util.h

Issue 664933004: Standardize usage of virtual/override/final in extensions/ (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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_ 5 #ifndef EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_
6 #define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_ 6 #define EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_
7 7
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 scoped_refptr<const Extension> AddExtensionWithIdAndPermissions( 53 scoped_refptr<const Extension> AddExtensionWithIdAndPermissions(
54 content::BrowserContext* context, 54 content::BrowserContext* context,
55 const std::string& id, 55 const std::string& id,
56 Manifest::Type type, 56 Manifest::Type type,
57 const std::set<std::string>& permissions); 57 const std::set<std::string>& permissions);
58 58
59 // A MockExtensionSystem to serve an EventRouter. 59 // A MockExtensionSystem to serve an EventRouter.
60 class MockExtensionSystemWithEventRouter : public MockExtensionSystem { 60 class MockExtensionSystemWithEventRouter : public MockExtensionSystem {
61 public: 61 public:
62 explicit MockExtensionSystemWithEventRouter(content::BrowserContext* context); 62 explicit MockExtensionSystemWithEventRouter(content::BrowserContext* context);
63 virtual ~MockExtensionSystemWithEventRouter(); 63 ~MockExtensionSystemWithEventRouter() override;
64 64
65 // Factory method for SetTestingFactoryAndUse. 65 // Factory method for SetTestingFactoryAndUse.
66 static KeyedService* Build(content::BrowserContext* context); 66 static KeyedService* Build(content::BrowserContext* context);
67 67
68 // MockExtensionSystem overrides: 68 // MockExtensionSystem overrides:
69 virtual EventRouter* event_router() override; 69 EventRouter* event_router() override;
70 70
71 private: 71 private:
72 scoped_ptr<EventRouter> event_router_; 72 scoped_ptr<EventRouter> event_router_;
73 73
74 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystemWithEventRouter); 74 DISALLOW_COPY_AND_ASSIGN(MockExtensionSystemWithEventRouter);
75 }; 75 };
76 76
77 // SettingsStorageFactory which acts as a wrapper for other factories. 77 // SettingsStorageFactory which acts as a wrapper for other factories.
78 class ScopedSettingsStorageFactory : public SettingsStorageFactory { 78 class ScopedSettingsStorageFactory : public SettingsStorageFactory {
79 public: 79 public:
80 ScopedSettingsStorageFactory(); 80 ScopedSettingsStorageFactory();
81 81
82 explicit ScopedSettingsStorageFactory( 82 explicit ScopedSettingsStorageFactory(
83 const scoped_refptr<SettingsStorageFactory>& delegate); 83 const scoped_refptr<SettingsStorageFactory>& delegate);
84 84
85 // Sets the delegate factory (equivalent to scoped_ptr::reset). 85 // Sets the delegate factory (equivalent to scoped_ptr::reset).
86 void Reset(const scoped_refptr<SettingsStorageFactory>& delegate); 86 void Reset(const scoped_refptr<SettingsStorageFactory>& delegate);
87 87
88 // SettingsStorageFactory implementation. 88 // SettingsStorageFactory implementation.
89 virtual ValueStore* Create(const base::FilePath& base_path, 89 ValueStore* Create(const base::FilePath& base_path,
90 const std::string& extension_id) override; 90 const std::string& extension_id) override;
91 virtual void DeleteDatabaseIfExists( 91 void DeleteDatabaseIfExists(const base::FilePath& base_path,
92 const base::FilePath& base_path, 92 const std::string& extension_id) override;
93 const std::string& extension_id) override;
94 93
95 private: 94 private:
96 // SettingsStorageFactory is refcounted. 95 // SettingsStorageFactory is refcounted.
97 virtual ~ScopedSettingsStorageFactory(); 96 ~ScopedSettingsStorageFactory() override;
98 97
99 scoped_refptr<SettingsStorageFactory> delegate_; 98 scoped_refptr<SettingsStorageFactory> delegate_;
100 }; 99 };
101 100
102 } // namespace settings_test_util 101 } // namespace settings_test_util
103 102
104 } // namespace extensions 103 } // namespace extensions
105 104
106 #endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_ 105 #endif // EXTENSIONS_BROWSER_API_STORAGE_SETTINGS_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « extensions/browser/api/storage/settings_storage_quota_enforcer.h ('k') | extensions/browser/api/storage/storage_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698