OLD | NEW |
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 scoped_ptr<Event> event(new Event( | 85 scoped_ptr<Event> event(new Event( |
86 api::signed_in_devices::OnDeviceInfoChange::kEventName, | 86 api::signed_in_devices::OnDeviceInfoChange::kEventName, |
87 result.Pass())); | 87 result.Pass())); |
88 | 88 |
89 event->restrict_to_browser_context = profile_; | 89 event->restrict_to_browser_context = profile_; |
90 | 90 |
91 ExtensionSystem::Get(profile_)->event_router()->DispatchEventToExtension( | 91 ExtensionSystem::Get(profile_)->event_router()->DispatchEventToExtension( |
92 extension_id_, event.Pass()); | 92 extension_id_, event.Pass()); |
93 } | 93 } |
94 | 94 |
95 static base::LazyInstance<ProfileKeyedAPIFactory<SignedInDevicesManager> > | 95 static base::LazyInstance< |
96 g_factory = LAZY_INSTANCE_INITIALIZER; | 96 BrowserContextKeyedAPIFactory<SignedInDevicesManager> > g_factory = |
| 97 LAZY_INSTANCE_INITIALIZER; |
97 | 98 |
98 // static | 99 // static |
99 ProfileKeyedAPIFactory<SignedInDevicesManager>* | 100 BrowserContextKeyedAPIFactory<SignedInDevicesManager>* |
100 SignedInDevicesManager::GetFactoryInstance() { | 101 SignedInDevicesManager::GetFactoryInstance() { |
101 return g_factory.Pointer(); | 102 return g_factory.Pointer(); |
102 } | 103 } |
103 | 104 |
104 SignedInDevicesManager::SignedInDevicesManager() | 105 SignedInDevicesManager::SignedInDevicesManager() |
105 : profile_(NULL) {} | 106 : profile_(NULL) {} |
106 | 107 |
107 SignedInDevicesManager::SignedInDevicesManager(content::BrowserContext* context) | 108 SignedInDevicesManager::SignedInDevicesManager(content::BrowserContext* context) |
108 : profile_(Profile::FromBrowserContext(context)) { | 109 : profile_(Profile::FromBrowserContext(context)) { |
109 extensions::EventRouter* router = extensions::ExtensionSystem::Get( | 110 extensions::EventRouter* router = extensions::ExtensionSystem::Get( |
110 profile_)->event_router(); | 111 profile_)->event_router(); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 int type, | 163 int type, |
163 const content::NotificationSource& source, | 164 const content::NotificationSource& source, |
164 const content::NotificationDetails& details) { | 165 const content::NotificationDetails& details) { |
165 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED); | 166 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED); |
166 UnloadedExtensionInfo* reason = | 167 UnloadedExtensionInfo* reason = |
167 content::Details<UnloadedExtensionInfo>(details).ptr(); | 168 content::Details<UnloadedExtensionInfo>(details).ptr(); |
168 RemoveChangeObserverForExtension(reason->extension->id()); | 169 RemoveChangeObserverForExtension(reason->extension->id()); |
169 } | 170 } |
170 | 171 |
171 } // namespace extensions | 172 } // namespace extensions |
OLD | NEW |