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 0355ee7e2ad6279726f037212487ea77ff267862..d9d8bbe571138c54b5ce18a53cd349cde5f8445f 100644 |
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc |
@@ -116,25 +116,26 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension, |
bool enabled = service->IsExtensionEnabled(extension->id()) && |
!service->GetTerminatedExtension(extension->id()); |
bool icon_big_exists = true; |
+ // Instead of setting grayscale here, we do it in the js. |
Evan Stade
2011/08/30 03:34:14
probably best to check for NTP4
Yoyo Zhou
2011/08/30 17:37:10
Done.
|
GURL icon_big = |
ExtensionIconSource::GetIconURL(extension, |
Extension::EXTENSION_ICON_LARGE, |
ExtensionIconSet::MATCH_EXACTLY, |
- !enabled, &icon_big_exists); |
+ false, &icon_big_exists); |
bool icon_small_exists = true; |
GURL icon_small = |
ExtensionIconSource::GetIconURL(extension, |
Extension::EXTENSION_ICON_BITTY, |
ExtensionIconSet::MATCH_BIGGER, |
- !enabled, &icon_small_exists); |
+ false, &icon_small_exists); |
value->Clear(); |
value->SetString("id", extension->id()); |
value->SetString("name", extension->name()); |
value->SetString("description", extension->description()); |
value->SetString("launch_url", extension->GetFullLaunchURL().spec()); |
- if (enabled) |
- value->SetString("options_url", extension->options_url().spec()); |
+ value->SetBoolean("enabled", enabled); |
+ value->SetString("options_url", extension->options_url().spec()); |
value->SetBoolean("can_uninstall", |
Extension::UserMayDisable(extension->location())); |
value->SetString("icon_big", icon_big.spec()); |
@@ -146,6 +147,7 @@ void AppLauncherHandler::CreateAppInfo(const Extension* extension, |
value->SetInteger("launch_type", |
prefs->GetLaunchType(extension->id(), |
ExtensionPrefs::LAUNCH_DEFAULT)); |
+ value->SetBoolean("offline_enabled", extension->offline_enabled()); |
value->SetBoolean("is_component", |
extension->location() == Extension::COMPONENT); |
value->SetBoolean("is_webstore", |
@@ -294,6 +296,9 @@ void AppLauncherHandler::Observe(int type, |
case chrome::NOTIFICATION_EXTENSION_UNLOADED: { |
const Extension* extension = |
Details<UnloadedExtensionInfo>(details)->extension; |
+ bool is_uninstall = |
Evan Stade
2011/08/30 03:34:14
define this right above first use, not here
Yoyo Zhou
2011/08/30 17:37:10
Done.
|
+ (Details<UnloadedExtensionInfo>(details)->reason == |
Evan Stade
2011/08/30 03:34:14
don't need ()
Yoyo Zhou
2011/08/30 17:37:10
Gone.
|
+ extension_misc::UNLOAD_REASON_UNINSTALL); |
if (!extension->is_app()) |
return; |
@@ -303,9 +308,12 @@ void AppLauncherHandler::Observe(int type, |
} |
scoped_ptr<DictionaryValue> app_info(GetAppInfo(extension)); |
- if (app_info.get()) |
- web_ui_->CallJavascriptFunction("ntp4.appRemoved", *app_info); |
- break; |
+ scoped_ptr<BooleanValue> uninstall_value( |
+ Value::CreateBooleanValue(is_uninstall)); |
+ if (app_info.get()) { |
+ web_ui_->CallJavascriptFunction( |
+ "ntp4.appRemoved", *app_info, *uninstall_value); |
+ } |
Evan Stade
2011/08/30 03:34:14
no break?
Yoyo Zhou
2011/08/30 17:37:10
Argh, lost it in the merge. Good catch.
|
} |
case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED: |
// The promo may not load until a couple seconds after the first NTP view, |