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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 9370013: Simplify the handling of crashed extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
index dfc0cb86288eb52c2cc27f021018b7e39cb19782..c8899f49a4edae094082440abf213438d6a6b8bc 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -111,8 +111,7 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension,
const AppNotification* notification,
ExtensionService* service,
DictionaryValue* value) {
- bool enabled = service->IsExtensionEnabled(extension->id()) &&
- !service->GetTerminatedExtension(extension->id());
+ bool enabled = service->IsExtensionEnabled(extension->id());
bool icon_big_exists = true;
// Instead of setting grayscale here, we do it in apps_page.js.
GURL icon_big =
@@ -378,18 +377,6 @@ void AppLauncherHandler::FillAppDictionary(DictionaryValue* dictionary) {
}
}
- extensions = extension_service_->terminated_extensions();
- for (it = extensions->begin(); it != extensions->end(); ++it) {
- if (!IsAppExcludedFromList(*it)) {
- DictionaryValue* app_info = new DictionaryValue();
- CreateAppInfo(*it,
- NULL,
- extension_service_,
- app_info);
- list->Append(app_info);
- }
- }
-
dictionary->Set("apps", list);
// TODO(estade): remove these settings when the old NTP is removed. The new
@@ -888,22 +875,14 @@ void AppLauncherHandler::RecordAppLaunchByURL(
void AppLauncherHandler::PromptToEnableApp(const std::string& extension_id) {
const Extension* extension =
extension_service_->GetExtensionById(extension_id, true);
- if (!extension) {
- extension = extension_service_->GetTerminatedExtension(extension_id);
- // It's possible (though unlikely) the app could have been uninstalled since
- // the user clicked on it.
- if (!extension)
- return;
- // If the app was terminated, reload it first. (This reallocates the
- // Extension object.)
- extension_service_->ReloadExtension(extension_id);
- extension = extension_service_->GetExtensionById(extension_id, true);
- }
+ // It's possible (though unlikely) the app could have been uninstalled since
+ // the user clicked on it.
+ if (!extension)
+ return;
ExtensionPrefs* extension_prefs = extension_service_->extension_prefs();
if (!extension_prefs->DidExtensionEscalatePermissions(extension_id)) {
// Enable the extension immediately if its privileges weren't escalated.
- // This is a no-op if the extension was previously terminated.
extension_service_->EnableExtension(extension_id);
// Launch app asynchronously so the image will update.

Powered by Google App Engine
This is Rietveld 408576698