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

Unified Diff: chrome/browser/dom_ui/app_launcher_handler.cc

Issue 6543017: Track which apps the user has re-ordered on the NTP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix presubmit check Created 9 years, 10 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 | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/app_launcher_handler.cc
diff --git a/chrome/browser/dom_ui/app_launcher_handler.cc b/chrome/browser/dom_ui/app_launcher_handler.cc
index 25706503c109115011780ea578a50934bcc1bfe1..c171ce0958bba2fc0ae152dec293ea7bbbdcf7b9 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.cc
+++ b/chrome/browser/dom_ui/app_launcher_handler.cc
@@ -424,13 +424,21 @@ void AppLauncherHandler::HandleCreateAppShortcut(const ListValue* args) {
}
void AppLauncherHandler::HandleReorderApps(const ListValue* args) {
+ CHECK(args->GetSize() == 2);
+
+ std::string dragged_app_id;
+ ListValue* app_order;
+ CHECK(args->GetString(0, &dragged_app_id));
+ CHECK(args->GetList(1, &app_order));
+
std::vector<std::string> extension_ids;
- for (size_t i = 0; i < args->GetSize(); ++i) {
+ for (size_t i = 0; i < app_order->GetSize(); ++i) {
std::string value;
- if (args->GetString(i, &value))
+ if (app_order->GetString(i, &value))
extension_ids.push_back(value);
}
+ extensions_service_->extension_prefs()->SetAppDraggedByUser(dragged_app_id);
extensions_service_->extension_prefs()->SetAppLauncherOrder(extension_ids);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698