| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 ++it) { | 71 ++it) { |
| 72 linked_ptr<api::signed_in_devices::DeviceInfo> api_device = | 72 linked_ptr<api::signed_in_devices::DeviceInfo> api_device = |
| 73 make_linked_ptr(new api::signed_in_devices::DeviceInfo); | 73 make_linked_ptr(new api::signed_in_devices::DeviceInfo); |
| 74 FillDeviceInfo(*(*it), api_device.get()); | 74 FillDeviceInfo(*(*it), api_device.get()); |
| 75 args.push_back(api_device); | 75 args.push_back(api_device); |
| 76 } | 76 } |
| 77 | 77 |
| 78 scoped_ptr<base::ListValue> result = | 78 scoped_ptr<base::ListValue> result = |
| 79 api::signed_in_devices::OnDeviceInfoChange::Create(args); | 79 api::signed_in_devices::OnDeviceInfoChange::Create(args); |
| 80 scoped_ptr<Event> event(new Event( | 80 scoped_ptr<Event> event(new Event( |
| 81 api::signed_in_devices::OnDeviceInfoChange::kEventName, | 81 events::UNKNOWN, api::signed_in_devices::OnDeviceInfoChange::kEventName, |
| 82 result.Pass())); | 82 result.Pass())); |
| 83 | 83 |
| 84 event->restrict_to_browser_context = profile_; | 84 event->restrict_to_browser_context = profile_; |
| 85 | 85 |
| 86 EventRouter::Get(profile_)->DispatchEventToExtension( | 86 EventRouter::Get(profile_)->DispatchEventToExtension( |
| 87 extension_id_, event.Pass()); | 87 extension_id_, event.Pass()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 static base::LazyInstance< | 90 static base::LazyInstance< |
| 91 BrowserContextKeyedAPIFactory<SignedInDevicesManager> > g_factory = | 91 BrowserContextKeyedAPIFactory<SignedInDevicesManager> > g_factory = |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } | 159 } |
| 160 | 160 |
| 161 void SignedInDevicesManager::OnExtensionUnloaded( | 161 void SignedInDevicesManager::OnExtensionUnloaded( |
| 162 content::BrowserContext* browser_context, | 162 content::BrowserContext* browser_context, |
| 163 const Extension* extension, | 163 const Extension* extension, |
| 164 UnloadedExtensionInfo::Reason reason) { | 164 UnloadedExtensionInfo::Reason reason) { |
| 165 RemoveChangeObserverForExtension(extension->id()); | 165 RemoveChangeObserverForExtension(extension->id()); |
| 166 } | 166 } |
| 167 | 167 |
| 168 } // namespace extensions | 168 } // namespace extensions |
| OLD | NEW |