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

Unified Diff: chrome/browser/extensions/api/system_info/system_info_api.cc

Issue 174513003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/system_info/system_info_api.cc
diff --git a/chrome/browser/extensions/api/system_info/system_info_api.cc b/chrome/browser/extensions/api/system_info/system_info_api.cc
index 90bde75c2bc3cd7ac8e3779554e6601325071c39..25a79d5f49044ae8df17b7e64f197501122caa2c 100644
--- a/chrome/browser/extensions/api/system_info/system_info_api.cc
+++ b/chrome/browser/extensions/api/system_info/system_info_api.cc
@@ -222,8 +222,9 @@ ProfileKeyedAPIFactory<SystemInfoAPI>* SystemInfoAPI::GetFactoryInstance() {
return g_factory.Pointer();
}
-SystemInfoAPI::SystemInfoAPI(Profile* profile) : profile_(profile) {
- EventRouter* router = ExtensionSystem::Get(profile_)->event_router();
+SystemInfoAPI::SystemInfoAPI(content::BrowserContext* context)
+ : browser_context_(context) {
+ EventRouter* router = ExtensionSystem::Get(browser_context_)->event_router();
router->RegisterObserver(this, system_storage::OnAttached::kEventName);
router->RegisterObserver(this, system_storage::OnDetached::kEventName);
router->RegisterObserver(this, system_display::OnDisplayChanged::kEventName);
@@ -233,7 +234,8 @@ SystemInfoAPI::~SystemInfoAPI() {
}
void SystemInfoAPI::Shutdown() {
- ExtensionSystem::Get(profile_)->event_router()->UnregisterObserver(this);
+ ExtensionSystem::Get(browser_context_)->event_router()->UnregisterObserver(
+ this);
}
void SystemInfoAPI::OnListenerAdded(const EventListenerInfo& details) {

Powered by Google App Engine
This is Rietveld 408576698