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

Side by Side Diff: chrome/browser/background/background_contents_service.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 (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/background/background_contents_service.h" 5 #include "chrome/browser/background/background_contents_service.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 Profile* profile, 166 Profile* profile,
167 const gfx::Image& icon) { 167 const gfx::Image& icon) {
168 gfx::Image notification_icon(icon); 168 gfx::Image notification_icon(icon);
169 if (notification_icon.IsEmpty()) { 169 if (notification_icon.IsEmpty()) {
170 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 170 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
171 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON); 171 notification_icon = rb.GetImageNamed(IDR_EXTENSION_DEFAULT_ICON);
172 } 172 }
173 173
174 // Origin URL must be different from the crashed extension to avoid the 174 // Origin URL must be different from the crashed extension to avoid the
175 // conflict. NotificationSystemObserver will cancel all notifications from 175 // conflict. NotificationSystemObserver will cancel all notifications from
176 // the same origin when NOTIFICATION_EXTENSION_UNLOADED. 176 // the same origin when NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED.
177 // TODO(mukai, dewittj): remove this and switch to message center 177 // TODO(mukai, dewittj): remove this and switch to message center
178 // notifications. 178 // notifications.
179 DesktopNotificationService::AddIconNotification( 179 DesktopNotificationService::AddIconNotification(
180 GURL() /* empty origin */, 180 GURL() /* empty origin */,
181 base::string16(), 181 base::string16(),
182 message, 182 message,
183 notification_icon, 183 notification_icon,
184 base::string16(), 184 base::string16(),
185 delegate.get(), 185 delegate.get(),
186 profile); 186 profile);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 332
333 // Track when the extensions crash so that the user can be notified 333 // Track when the extensions crash so that the user can be notified
334 // about it, and the crashed contents can be restarted. 334 // about it, and the crashed contents can be restarted.
335 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED, 335 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
336 content::Source<Profile>(profile)); 336 content::Source<Profile>(profile));
337 registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED, 337 registrar_.Add(this, chrome::NOTIFICATION_BACKGROUND_CONTENTS_TERMINATED,
338 content::Source<Profile>(profile)); 338 content::Source<Profile>(profile));
339 339
340 // Listen for extensions to be unloaded so we can shutdown associated 340 // Listen for extensions to be unloaded so we can shutdown associated
341 // BackgroundContents. 341 // BackgroundContents.
342 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED, 342 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
343 content::Source<Profile>(profile)); 343 content::Source<Profile>(profile));
344 344
345 // Make sure the extension-crash balloons are removed when the extension is 345 // Make sure the extension-crash balloons are removed when the extension is
346 // uninstalled/reloaded. We cannot do this from UNLOADED since a crashed 346 // uninstalled/reloaded. We cannot do this from UNLOADED since a crashed
347 // extension is unloaded immediately after the crash, not when user reloads or 347 // extension is unloaded immediately after the crash, not when user reloads or
348 // uninstalls the extension. 348 // uninstalls the extension.
349 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED, 349 registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNINSTALLED,
350 content::Source<Profile>(profile)); 350 content::Source<Profile>(profile));
351 } 351 }
352 352
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 extensions::Manifest::IsComponentLocation(extension->location()) || 449 extensions::Manifest::IsComponentLocation(extension->location()) ||
450 extensions::Manifest::IsPolicyLocation(extension->location()); 450 extensions::Manifest::IsPolicyLocation(extension->location());
451 if (!force_installed) { 451 if (!force_installed) {
452 ShowBalloon(extension, profile); 452 ShowBalloon(extension, profile);
453 } else { 453 } else {
454 // Restart the extension. 454 // Restart the extension.
455 RestartForceInstalledExtensionOnCrash(extension, profile); 455 RestartForceInstalledExtensionOnCrash(extension, profile);
456 } 456 }
457 break; 457 break;
458 } 458 }
459 case chrome::NOTIFICATION_EXTENSION_UNLOADED: 459 case chrome::NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED:
460 switch (content::Details<UnloadedExtensionInfo>(details)->reason) { 460 switch (content::Details<UnloadedExtensionInfo>(details)->reason) {
461 case UnloadedExtensionInfo::REASON_DISABLE: // Fall through. 461 case UnloadedExtensionInfo::REASON_DISABLE: // Fall through.
462 case UnloadedExtensionInfo::REASON_TERMINATE: // Fall through. 462 case UnloadedExtensionInfo::REASON_TERMINATE: // Fall through.
463 case UnloadedExtensionInfo::REASON_UNINSTALL: // Fall through. 463 case UnloadedExtensionInfo::REASON_UNINSTALL: // Fall through.
464 case UnloadedExtensionInfo::REASON_BLACKLIST: 464 case UnloadedExtensionInfo::REASON_BLACKLIST:
465 ShutdownAssociatedBackgroundContents(base::ASCIIToUTF16( 465 ShutdownAssociatedBackgroundContents(base::ASCIIToUTF16(
466 content::Details<UnloadedExtensionInfo>(details)-> 466 content::Details<UnloadedExtensionInfo>(details)->
467 extension->id())); 467 extension->id()));
468 SendChangeNotification(content::Source<Profile>(source).ptr()); 468 SendChangeNotification(content::Source<Profile>(source).ptr());
469 break; 469 break;
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 bool user_gesture, 779 bool user_gesture,
780 bool* was_blocked) { 780 bool* was_blocked) {
781 Browser* browser = chrome::FindLastActiveWithProfile( 781 Browser* browser = chrome::FindLastActiveWithProfile(
782 Profile::FromBrowserContext(new_contents->GetBrowserContext()), 782 Profile::FromBrowserContext(new_contents->GetBrowserContext()),
783 chrome::GetActiveDesktop()); 783 chrome::GetActiveDesktop());
784 if (browser) { 784 if (browser) {
785 chrome::AddWebContents(browser, NULL, new_contents, disposition, 785 chrome::AddWebContents(browser, NULL, new_contents, disposition,
786 initial_pos, user_gesture, was_blocked); 786 initial_pos, user_gesture, was_blocked);
787 } 787 }
788 } 788 }
OLDNEW
« no previous file with comments | « chrome/browser/background/background_application_list_model.cc ('k') | chrome/browser/chrome_notification_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698