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

Unified Diff: chrome/browser/extensions/api/autotest_private/autotest_private_api.h

Issue 168253002: Cleanup many APIs to use ProfileKeyedAPI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/autotest_private/autotest_private_api.h
diff --git a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
index e0a565bac7021e65b6518a05cdbd19a1bacc7780..4baeae27d06672071abdc8d7d1ed0ba5ca96230c 100644
--- a/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
+++ b/chrome/browser/extensions/api/autotest_private/autotest_private_api.h
@@ -8,8 +8,8 @@
#include <string>
#include "base/compiler_specific.h"
+#include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
#include "chrome/browser/extensions/chrome_extension_function.h"
-#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
namespace extensions {
@@ -87,20 +87,33 @@ class AutotestPrivateSimulateAsanMemoryBugFunction
void SetAutotestPrivateTest();
// The profile-keyed service that manages the autotestPrivate extension API.
-class AutotestPrivateAPI : public BrowserContextKeyedService {
+class AutotestPrivateAPI : public ProfileKeyedAPI {
public:
- AutotestPrivateAPI();
+ static ProfileKeyedAPIFactory<AutotestPrivateAPI>* GetFactoryInstance();
// TODO(achuith): Replace these with a mock object for system calls.
bool test_mode() const { return test_mode_; }
void set_test_mode(bool test_mode) { test_mode_ = test_mode; }
private:
+ friend class ProfileKeyedAPIFactory<AutotestPrivateAPI>;
+
+ AutotestPrivateAPI();
virtual ~AutotestPrivateAPI();
+ // ProfileKeyedAPI implementation.
+ static const char* service_name() { return "AutotestPrivateAPI"; }
+ static const bool kServiceIsNULLWhileTesting = true;
+ static const bool kServiceRedirectedInIncognito = true;
+
bool test_mode_; // true for ExtensionApiTest.AutotestPrivate browser test.
};
+template <>
+BrowserContextKeyedService*
+ ProfileKeyedAPIFactory<AutotestPrivateAPI>::BuildServiceInstanceFor(
+ content::BrowserContext* context) const;
+
} // namespace extensions
#endif // CHROME_BROWSER_EXTENSIONS_API_AUTOTEST_PRIVATE_AUTOTEST_PRIVATE_API_H_

Powered by Google App Engine
This is Rietveld 408576698