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

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

Issue 9116037: [NTP4] Make TilePage and CardSlider evented to simplify code and fix page switcher bug (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: found one more bug when you leave a tab while mousing over page switcher Created 8 years, 11 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/ui/webui/ntp/app_launcher_handler.h ('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 29184273ad9694b699a50676850b86bda2e276bc..ef81c8e661ee337a839a066919c4764981c092f1 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.cc
@@ -305,8 +305,10 @@ void AppLauncherHandler::Observe(int type,
content::Details<UnloadedExtensionInfo>(details)->reason ==
extension_misc::UNLOAD_REASON_UNINSTALL));
if (app_info.get()) {
+ scoped_ptr<base::FundamentalValue> from_page(
+ Value::CreateBooleanValue(!extension_id_prompting_.empty()));
web_ui()->CallJavascriptFunction(
- "ntp4.appRemoved", *app_info, *uninstall_value);
+ "ntp4.appRemoved", *app_info, *uninstall_value, *from_page);
}
break;
}
@@ -314,7 +316,7 @@ void AppLauncherHandler::Observe(int type,
// The promo may not load until a couple seconds after the first NTP view,
// so we listen for the load notification and notify the NTP when ready.
case chrome::NOTIFICATION_WEB_STORE_PROMO_LOADED:
- // TODO(estade): try to get rid of this inefficient operation.
+ // TODO(estade): Try to get rid of this inefficient operation.
HandleGetApps(NULL);
break;
case chrome::NOTIFICATION_PREF_CHANGED: {
@@ -329,7 +331,7 @@ void AppLauncherHandler::Observe(int type,
crx_installer->profile())) {
return;
}
- // Fall Through.
+ // Fall through.
}
case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: {
attempted_bookmark_app_install_ = false;
@@ -842,6 +844,10 @@ void AppLauncherHandler::RegisterUserPrefs(PrefService* pref_service) {
PrefService::UNSYNCABLE_PREF);
}
+void AppLauncherHandler::CleanupAfterUninstall() {
+ extension_id_prompting_.clear();
+}
+
// static
void AppLauncherHandler::RecordWebStoreLaunch(bool promo_active) {
UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram,
@@ -927,12 +933,11 @@ void AppLauncherHandler::ExtensionUninstallAccepted() {
extension_service_->UninstallExtension(extension_id_prompting_,
false /* external_uninstall */, NULL);
-
- extension_id_prompting_ = "";
+ CleanupAfterUninstall();
}
void AppLauncherHandler::ExtensionUninstallCanceled() {
- extension_id_prompting_ = "";
+ CleanupAfterUninstall();
}
void AppLauncherHandler::InstallUIProceed() {
@@ -969,7 +974,7 @@ void AppLauncherHandler::InstallUIAbort(bool user_initiated) {
ExtensionService::RecordPermissionMessagesHistogram(
extension, histogram_name.c_str());
- ExtensionUninstallCanceled();
+ CleanupAfterUninstall();
}
ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
« no previous file with comments | « chrome/browser/ui/webui/ntp/app_launcher_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698