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

Unified Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 179243002: Change ProfileKeyedAPIFactory to build instances with BrowserContext instead of Profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: locationbarview 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/cookies/cookies_api.cc
diff --git a/chrome/browser/extensions/api/cookies/cookies_api.cc b/chrome/browser/extensions/api/cookies/cookies_api.cc
index 6df1a70ae9d76132efd428836de16ecd128321a3..4eb83b4e44121e2f1ab7868b1b5e9b309460ecd8 100644
--- a/chrome/browser/extensions/api/cookies/cookies_api.cc
+++ b/chrome/browser/extensions/api/cookies/cookies_api.cc
@@ -560,9 +560,9 @@ void CookiesGetAllCookieStoresFunction::Run() {
SendResponse(RunImpl());
}
-CookiesAPI::CookiesAPI(Profile* profile)
- : profile_(profile) {
- ExtensionSystem::Get(profile_)->event_router()->RegisterObserver(
+CookiesAPI::CookiesAPI(content::BrowserContext* context)
+ : browser_context_(context) {
+ ExtensionSystem::Get(browser_context_)->event_router()->RegisterObserver(
this, cookies::OnChanged::kEventName);
}
@@ -570,7 +570,8 @@ CookiesAPI::~CookiesAPI() {
}
void CookiesAPI::Shutdown() {
- ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
+ ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
+ this);
}
static base::LazyInstance<ProfileKeyedAPIFactory<CookiesAPI> >
@@ -583,8 +584,9 @@ ProfileKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() {
void CookiesAPI::OnListenerAdded(
const extensions::EventListenerInfo& details) {
- cookies_event_router_.reset(new CookiesEventRouter(profile_));
- ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
+ cookies_event_router_.reset(new CookiesEventRouter(browser_context_));
+ ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
+ this);
}
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698