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

Side by Side Diff: chrome/browser/extensions/api/developer_private/developer_private_api.cc

Issue 242613004: Replace NOTIFICATION_EXTENSION_LOADED to NOTIFICATION_EXTENSION_LOADED_DEPRECATED (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/developer_private/developer_private_api. h" 5 #include "chrome/browser/extensions/api/developer_private/developer_private_api. h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/app_restore_service.h" 8 #include "apps/app_restore_service.h"
9 #include "apps/app_window.h" 9 #include "apps/app_window.h"
10 #include "apps/app_window_registry.h" 10 #include "apps/app_window_registry.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 return GetFactoryInstance()->Get(context); 166 return GetFactoryInstance()->Get(context);
167 } 167 }
168 168
169 DeveloperPrivateAPI::DeveloperPrivateAPI(content::BrowserContext* context) 169 DeveloperPrivateAPI::DeveloperPrivateAPI(content::BrowserContext* context)
170 : profile_(Profile::FromBrowserContext(context)) { 170 : profile_(Profile::FromBrowserContext(context)) {
171 RegisterNotifications(); 171 RegisterNotifications();
172 } 172 }
173 173
174 DeveloperPrivateEventRouter::DeveloperPrivateEventRouter(Profile* profile) 174 DeveloperPrivateEventRouter::DeveloperPrivateEventRouter(Profile* profile)
175 : profile_(profile) { 175 : profile_(profile) {
176 int types[] = { 176 int types[] = {chrome::NOTIFICATION_EXTENSION_INSTALLED,
177 chrome::NOTIFICATION_EXTENSION_INSTALLED, 177 chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
178 chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 178 chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
179 chrome::NOTIFICATION_EXTENSION_LOADED, 179 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
180 chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED, 180 chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED,
181 chrome::NOTIFICATION_EXTENSION_VIEW_REGISTERED, 181 chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED};
182 chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED
183 };
184 182
185 CHECK(registrar_.IsEmpty()); 183 CHECK(registrar_.IsEmpty());
186 for (size_t i = 0; i < arraysize(types); ++i) { 184 for (size_t i = 0; i < arraysize(types); ++i) {
187 registrar_.Add(this, 185 registrar_.Add(this,
188 types[i], 186 types[i],
189 content::Source<Profile>(profile_)); 187 content::Source<Profile>(profile_));
190 } 188 }
191 189
192 ErrorConsole::Get(profile)->AddObserver(this); 190 ErrorConsole::Get(profile)->AddObserver(this);
193 } 191 }
(...skipping 26 matching lines...) Expand all
220 switch (type) { 218 switch (type) {
221 case chrome::NOTIFICATION_EXTENSION_INSTALLED: 219 case chrome::NOTIFICATION_EXTENSION_INSTALLED:
222 event_data.event_type = developer::EVENT_TYPE_INSTALLED; 220 event_data.event_type = developer::EVENT_TYPE_INSTALLED;
223 extension = 221 extension =
224 content::Details<const InstalledExtensionInfo>(details)->extension; 222 content::Details<const InstalledExtensionInfo>(details)->extension;
225 break; 223 break;
226 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED: 224 case chrome::NOTIFICATION_EXTENSION_UNINSTALLED:
227 event_data.event_type = developer::EVENT_TYPE_UNINSTALLED; 225 event_data.event_type = developer::EVENT_TYPE_UNINSTALLED;
228 extension = content::Details<const Extension>(details).ptr(); 226 extension = content::Details<const Extension>(details).ptr();
229 break; 227 break;
230 case chrome::NOTIFICATION_EXTENSION_LOADED: 228 case chrome::NOTIFICATION_EXTENSION_LOADED_DEPRECATED:
231 event_data.event_type = developer::EVENT_TYPE_LOADED; 229 event_data.event_type = developer::EVENT_TYPE_LOADED;
232 extension = content::Details<const Extension>(details).ptr(); 230 extension = content::Details<const Extension>(details).ptr();
233 break; 231 break;
234 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED: 232 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
235 event_data.event_type = developer::EVENT_TYPE_UNLOADED; 233 event_data.event_type = developer::EVENT_TYPE_UNLOADED;
236 extension = 234 extension =
237 content::Details<const UnloadedExtensionInfo>(details)->extension; 235 content::Details<const UnloadedExtensionInfo>(details)->extension;
238 break; 236 break;
239 case chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED: 237 case chrome::NOTIFICATION_EXTENSION_VIEW_UNREGISTERED:
240 event_data.event_type = developer::EVENT_TYPE_VIEW_UNREGISTERED; 238 event_data.event_type = developer::EVENT_TYPE_VIEW_UNREGISTERED;
(...skipping 1112 matching lines...) Expand 10 before | Expand all | Expand 10 after
1353 } 1351 }
1354 1352
1355 error_ui_util::HandleOpenDevTools(dict); 1353 error_ui_util::HandleOpenDevTools(dict);
1356 1354
1357 return true; 1355 return true;
1358 } 1356 }
1359 1357
1360 } // namespace api 1358 } // namespace api
1361 1359
1362 } // namespace extensions 1360 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698