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

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

Issue 8637001: [NTP4] Auto-deletion of empty apps panes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: more fixes and typos from reviewing myself Created 9 years 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.h
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.h b/chrome/browser/ui/webui/ntp/app_launcher_handler.h
index 35079ce98123ecafac714b8faa2a2b762e8b6de7..77f6b919f2e64fef40858657ab9d04b5ca9cf230 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.h
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.h
@@ -65,6 +65,10 @@ class AppLauncherHandler : public WebUIMessageHandler,
// Populate the given dictionary with the web store promo content.
void FillPromoDictionary(base::DictionaryValue* value);
+ // Callback for the "deleteAppsPage" message. Takes a page index as the first
+ // and only argument.
+ void HandleDeleteAppsPage(const base::ListValue* args);
+
// Callback for the "getApps" message.
void HandleGetApps(const base::ListValue* args);
@@ -92,8 +96,8 @@ class AppLauncherHandler : public WebUIMessageHandler,
// Callback for the "promoSeen" message.
void HandlePromoSeen(const base::ListValue* args);
- // Callback for the "saveAppPageName" message.
- void HandleSaveAppPageName(const base::ListValue* args);
+ // Callback for the "saveAppsPageName" message.
+ void HandleSaveAppsPageName(const base::ListValue* args);
// Callback for the "generateAppForLink" message.
void HandleGenerateAppForLink(const base::ListValue* args);
@@ -120,6 +124,24 @@ class AppLauncherHandler : public WebUIMessageHandler,
int page_index;
};
+ // Reset some instance flags we use to track the currently uninstalling app.
+ void CleanupAfterUninstall();
+
+ // Removes pages with no apps when loading from saved preferences. Does its
+ // best to avoid messing up save apps page names in the process.
+ void CondenseAppsPages();
+
+ // Deletes a range of empty apps pages.
+ void DeleteAppsPageRange(const size_t index, const size_t howmany);
+
+ // Make sure that the app has a valid page index before we do anything with
+ // this data.
+ static void EnsureAppHasPageIndex(ExtensionService* service,
+ const std::string& id);
+
+ // Return the number apps that have the given |page_index|.
+ int GetNumberOfAppsOnPage(const int page_index) const;
+
// Records a web store launch in the appropriate histograms. |promo_active|
// specifies if the web store promotion was active.
static void RecordWebStoreLaunch(bool promo_active);
@@ -199,6 +221,11 @@ class AppLauncherHandler : public WebUIMessageHandler,
// when the app is added to the page (via getAppsCallback or appAdded).
std::string highlight_app_id_;
+ // Used to determine if the current instance of AppLauncherHandler called
+ // ExtensionUninstallAccepted(). If the current one was the one that called
+ // this, we use this value to animate the removal on the attached NTP.
+ bool uninstall_from_page_;
+
// Hold state for favicon requests.
CancelableRequestConsumerTSimple<AppInstallInfo*> favicon_consumer_;

Powered by Google App Engine
This is Rietveld 408576698