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

Side by Side Diff: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_mana ger.h" 5 #include "chrome/browser/extensions/api/signed_in_devices/signed_in_devices_mana ger.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 97
98 // static 98 // static
99 ProfileKeyedAPIFactory<SignedInDevicesManager>* 99 ProfileKeyedAPIFactory<SignedInDevicesManager>*
100 SignedInDevicesManager::GetFactoryInstance() { 100 SignedInDevicesManager::GetFactoryInstance() {
101 return g_factory.Pointer(); 101 return g_factory.Pointer();
102 } 102 }
103 103
104 SignedInDevicesManager::SignedInDevicesManager() 104 SignedInDevicesManager::SignedInDevicesManager()
105 : profile_(NULL) {} 105 : profile_(NULL) {}
106 106
107 SignedInDevicesManager::SignedInDevicesManager(Profile* profile) 107 SignedInDevicesManager::SignedInDevicesManager(content::BrowserContext* context)
108 : profile_(profile) { 108 : profile_(Profile::FromBrowserContext(context)) {
109 extensions::EventRouter* router = extensions::ExtensionSystem::Get( 109 extensions::EventRouter* router = extensions::ExtensionSystem::Get(
110 profile_)->event_router(); 110 profile_)->event_router();
111 111
112 if (router) { 112 if (router) {
113 router->RegisterObserver( 113 router->RegisterObserver(
114 this, api::signed_in_devices::OnDeviceInfoChange::kEventName); 114 this, api::signed_in_devices::OnDeviceInfoChange::kEventName);
115 } 115 }
116 116
117 // Register for unload event so we could clear all our listeners when 117 // Register for unload event so we could clear all our listeners when
118 // extensions have unloaded. 118 // extensions have unloaded.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 int type, 162 int type,
163 const content::NotificationSource& source, 163 const content::NotificationSource& source,
164 const content::NotificationDetails& details) { 164 const content::NotificationDetails& details) {
165 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED); 165 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED);
166 UnloadedExtensionInfo* reason = 166 UnloadedExtensionInfo* reason =
167 content::Details<UnloadedExtensionInfo>(details).ptr(); 167 content::Details<UnloadedExtensionInfo>(details).ptr();
168 RemoveChangeObserverForExtension(reason->extension->id()); 168 RemoveChangeObserverForExtension(reason->extension->id());
169 } 169 }
170 170
171 } // namespace extensions 171 } // namespace extensions
172
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698