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 82b55fb1d71fcb3f17de08cfb446e2ac4050acf7..44e41cd96f4293eabcf68855da6474d621b04492 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); |
@@ -93,7 +97,7 @@ class AppLauncherHandler : public WebUIMessageHandler, |
void HandlePromoSeen(const base::ListValue* args); |
// Callback for the "saveAppPageName" message. |
- void HandleSaveAppPageName(const base::ListValue* args); |
+ void HandleSaveAppsPageName(const base::ListValue* args); |
// Callback for the "generateAppForLink" message. |
void HandleGenerateAppForLink(const base::ListValue* args); |
@@ -117,6 +121,21 @@ class AppLauncherHandler : public WebUIMessageHandler, |
int page_index; |
}; |
+ // 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); |
@@ -196,6 +215,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_; |