| OLD | NEW |
| 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 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 702 | 702 |
| 703 return true; | 703 return true; |
| 704 } | 704 } |
| 705 | 705 |
| 706 void ExtensionService::ReloadExtension(const std::string& extension_id) { | 706 void ExtensionService::ReloadExtension(const std::string& extension_id) { |
| 707 int events = HasShellWindows(extension_id) ? EVENT_LAUNCHED : EVENT_NONE; | 707 int events = HasShellWindows(extension_id) ? EVENT_LAUNCHED : EVENT_NONE; |
| 708 ReloadExtensionWithEvents(extension_id, events); | 708 ReloadExtensionWithEvents(extension_id, events); |
| 709 } | 709 } |
| 710 | 710 |
| 711 void ExtensionService::RestartExtension(const std::string& extension_id) { | 711 void ExtensionService::RestartExtension(const std::string& extension_id) { |
| 712 int events = HasShellWindows(extension_id) ? EVENT_RESTARTED : EVENT_NONE; | 712 ReloadExtensionWithEvents(extension_id, EVENT_RESTARTED); |
| 713 ReloadExtensionWithEvents(extension_id, events); | |
| 714 } | 713 } |
| 715 | 714 |
| 716 void ExtensionService::ReloadExtensionWithEvents( | 715 void ExtensionService::ReloadExtensionWithEvents( |
| 717 const std::string& extension_id, | 716 const std::string& extension_id, |
| 718 int events) { | 717 int events) { |
| 719 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 718 CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 720 FilePath path; | 719 FilePath path; |
| 721 const Extension* current_extension = GetExtensionById(extension_id, false); | 720 const Extension* current_extension = GetExtensionById(extension_id, false); |
| 722 | 721 |
| 723 // Disable the extension if it's loaded. It might not be loaded if it crashed. | 722 // Disable the extension if it's loaded. It might not be loaded if it crashed. |
| (...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3124 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); | 3123 scoped_refptr<const Extension> extension = GetInstalledExtension(*it); |
| 3125 DCHECK(extension); | 3124 DCHECK(extension); |
| 3126 if (!extension) | 3125 if (!extension) |
| 3127 continue; | 3126 continue; |
| 3128 blacklisted_extensions_.Insert(extension); | 3127 blacklisted_extensions_.Insert(extension); |
| 3129 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); | 3128 UnloadExtension(*it, extension_misc::UNLOAD_REASON_BLACKLIST); |
| 3130 } | 3129 } |
| 3131 | 3130 |
| 3132 IdentifyAlertableExtensions(); | 3131 IdentifyAlertableExtensions(); |
| 3133 } | 3132 } |
| OLD | NEW |