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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 11638053: Make crash bubble send onRestarted() to apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after
701 installer->InstallCrx(extension_path); 701 installer->InstallCrx(extension_path);
702 702
703 if (out_crx_installer) 703 if (out_crx_installer)
704 *out_crx_installer = installer; 704 *out_crx_installer = installer;
705 705
706 return true; 706 return true;
707 } 707 }
708 708
709 void ExtensionService::ReloadExtension(const std::string& extension_id) { 709 void ExtensionService::ReloadExtension(const std::string& extension_id) {
710 int events = HasShellWindows(extension_id) ? EVENT_LAUNCHED : EVENT_NONE; 710 int events = HasShellWindows(extension_id) ? EVENT_LAUNCHED : EVENT_NONE;
711 ReloadExtensionWithEvents(extension_id, events); 711 ReloadExtensionWithEvents(extension_id, events);
koz (OOO until 15th September) 2012/12/21 02:44:08 Do you know if there's a reason why these methods
712 } 712 }
713 713
714 void ExtensionService::RestartExtension(const std::string& extension_id) { 714 void ExtensionService::RestartExtension(const std::string& extension_id) {
benwells 2012/12/21 03:48:55 I don't understand why RestartExtension only resta
koz (OOO until 15th September) 2012/12/21 04:36:50 Done.
715 int events = HasShellWindows(extension_id) ? EVENT_RESTARTED : EVENT_NONE; 715 int events = HasShellWindows(extension_id) ? EVENT_RESTARTED : EVENT_NONE;
716 ReloadExtensionWithEvents(extension_id, events); 716 ReloadExtensionWithEvents(extension_id, events);
717 } 717 }
718 718
719 void ExtensionService::ReloadExtensionWithRestartEvent(
720 const std::string& extension_id) {
721 ReloadExtensionWithEvents(extension_id, EVENT_RESTARTED);
722 }
723
719 void ExtensionService::ReloadExtensionWithEvents( 724 void ExtensionService::ReloadExtensionWithEvents(
720 const std::string& extension_id, 725 const std::string& extension_id,
721 int events) { 726 int events) {
722 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 727 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
723 FilePath path; 728 FilePath path;
724 const Extension* current_extension = GetExtensionById(extension_id, false); 729 const Extension* current_extension = GetExtensionById(extension_id, false);
725 730
726 // Disable the extension if it's loaded. It might not be loaded if it crashed. 731 // Disable the extension if it's loaded. It might not be loaded if it crashed.
727 if (current_extension) { 732 if (current_extension) {
728 // If the extension has an inspector open for its background page, detach 733 // If the extension has an inspector open for its background page, detach
(...skipping 2402 matching lines...) Expand 10 before | Expand all | Expand 10 after
3131 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); 3136 scoped_refptr<const Extension> extension = GetInstalledExtension(*it);
3132 DCHECK(extension); 3137 DCHECK(extension);
3133 if (!extension) 3138 if (!extension)
3134 continue; 3139 continue;
3135 blacklisted_extensions_.Insert(extension); 3140 blacklisted_extensions_.Insert(extension);
3136 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); 3141 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST);
3137 } 3142 }
3138 3143
3139 IdentifyAlertableExtensions(); 3144 IdentifyAlertableExtensions();
3140 } 3145 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698