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

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

Issue 7792024: Show app disable and enable on NTP, and desaturate non-offline-enabled apps when offline. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: > Created 9 years, 4 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
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0801e68cfb2ac77322df028ccc854f64103a02ba..cdfbc8218a0b79c4cc71ce25b78eedffe9bab68d 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -117,24 +117,27 @@ 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 apps_page.js in NTP4.
+ bool grayscale = NewTabUI::NTP4Enabled() ? false : !enabled;
GURL icon_big =
ExtensionIconSource::GetIconURL(extension,
Extension::EXTENSION_ICON_LARGE,
ExtensionIconSet::MATCH_EXACTLY,
- !enabled, &icon_big_exists);
+ grayscale, &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);
+ grayscale, &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->SetBoolean("enabled", enabled);
+ if (NewTabUI::NTP4Enabled() || enabled)
value->SetString("options_url", extension->options_url().spec());
value->SetBoolean("can_uninstall",
Extension::UserMayDisable(extension->location()));
@@ -147,6 +150,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",
@@ -319,8 +323,14 @@ void AppLauncherHandler::Observe(int type,
}
scoped_ptr<DictionaryValue> app_info(GetAppInfo(extension));
- if (app_info.get())
- web_ui_->CallJavascriptFunction("ntp4.appRemoved", *app_info);
+ scoped_ptr<base::FundamentalValue> uninstall_value(
+ Value::CreateBooleanValue(
+ Details<UnloadedExtensionInfo>(details)->reason ==
+ extension_misc::UNLOAD_REASON_UNINSTALL));
+ if (app_info.get()) {
+ web_ui_->CallJavascriptFunction(
+ "ntp4.appRemoved", *app_info, *uninstall_value);
+ }
break;
}
case chrome::NOTIFICATION_EXTENSION_LAUNCHER_REORDERED:
« no previous file with comments | « chrome/browser/resources/ntp4/new_tab.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698