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

Side by Side Diff: chrome/browser/extensions/api/signed_in_devices/signed_in_devices_manager.cc

Issue 204703002: Rename NOTIFICATION_EXTENSION_UNLOADED to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: maybe upload wont do something bizarre this time Created 6 years, 9 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 extensions::EventRouter* router = extensions::ExtensionSystem::Get( 110 extensions::EventRouter* router = extensions::ExtensionSystem::Get(
111 profile_)->event_router(); 111 profile_)->event_router();
112 112
113 if (router) { 113 if (router) {
114 router->RegisterObserver( 114 router->RegisterObserver(
115 this, api::signed_in_devices::OnDeviceInfoChange::kEventName); 115 this, api::signed_in_devices::OnDeviceInfoChange::kEventName);
116 } 116 }
117 117
118 // Register for unload event so we could clear all our listeners when 118 // Register for unload event so we could clear all our listeners when
119 // extensions have unloaded. 119 // extensions have unloaded.
120 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 120 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
121 content::Source<Profile>(profile_->GetOriginalProfile())); 121 content::Source<Profile>(profile_->GetOriginalProfile()));
122 } 122 }
123 123
124 SignedInDevicesManager::~SignedInDevicesManager() {} 124 SignedInDevicesManager::~SignedInDevicesManager() {}
125 125
126 void SignedInDevicesManager::OnListenerAdded( 126 void SignedInDevicesManager::OnListenerAdded(
127 const EventListenerInfo& details) { 127 const EventListenerInfo& details) {
128 for (ScopedVector<SignedInDevicesChangeObserver>::const_iterator it = 128 for (ScopedVector<SignedInDevicesChangeObserver>::const_iterator it =
129 change_observers_.begin(); 129 change_observers_.begin();
130 it != change_observers_.end(); 130 it != change_observers_.end();
(...skipping 25 matching lines...) Expand all
156 change_observers_.erase(it); 156 change_observers_.erase(it);
157 return; 157 return;
158 } 158 }
159 } 159 }
160 } 160 }
161 161
162 void SignedInDevicesManager::Observe( 162 void SignedInDevicesManager::Observe(
163 int type, 163 int type,
164 const content::NotificationSource& source, 164 const content::NotificationSource& source,
165 const content::NotificationDetails& details) { 165 const content::NotificationDetails& details) {
166 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED); 166 DCHECK_EQ(type, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED);
167 UnloadedExtensionInfo* reason = 167 UnloadedExtensionInfo* reason =
168 content::Details<UnloadedExtensionInfo>(details).ptr(); 168 content::Details<UnloadedExtensionInfo>(details).ptr();
169 RemoveChangeObserverForExtension(reason->extension->id()); 169 RemoveChangeObserverForExtension(reason->extension->id());
170 } 170 }
171 171
172 } // namespace extensions 172 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698