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

Unified Diff: chrome/browser/extensions/api/profile_keyed_api_factory.h

Issue 13865012: Change GetProfileToUse method from Profile to content::BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: trybots Created 7 years, 8 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/profile_keyed_api_factory.h
diff --git a/chrome/browser/extensions/api/profile_keyed_api_factory.h b/chrome/browser/extensions/api/profile_keyed_api_factory.h
index 3e386451f5a909ab69c6f0c4f3b72156b2d0018b..fd8e0ec707b6e2596e8f77b35f7e610a251a9998 100644
--- a/chrome/browser/extensions/api/profile_keyed_api_factory.h
+++ b/chrome/browser/extensions/api/profile_keyed_api_factory.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_EXTENSIONS_API_PROFILE_KEYED_API_FACTORY_H_
#include "chrome/browser/extensions/extension_system_factory.h"
+#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_dependency_manager.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
@@ -94,8 +95,15 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
// ProfileKeyedBaseFactory implementation.
// These can be effectively overridden with template specializations.
- virtual bool ServiceRedirectedInIncognito() const OVERRIDE {
- return T::kServiceRedirectedInIncognito;
+ virtual content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* context) const OVERRIDE {
+ if (T::kServiceRedirectedInIncognito)
+ return chrome::GetBrowserContextRedirectedInIncognito(context);
+
+ if (T::kServiceHasOwnInstanceInIncognito)
+ return chrome::GetBrowserContextOwnInstanceInIncognito(context);
+
+ return ProfileKeyedServiceFactory::GetBrowserContextToUse(context);
}
virtual bool ServiceIsCreatedWithProfile() const OVERRIDE {
@@ -106,10 +114,6 @@ class ProfileKeyedAPIFactory : public ProfileKeyedServiceFactory {
return T::kServiceIsNULLWhileTesting;
}
- virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE {
- return T::kServiceHasOwnInstanceInIncognito;
- }
-
DISALLOW_COPY_AND_ASSIGN(ProfileKeyedAPIFactory);
};

Powered by Google App Engine
This is Rietveld 408576698