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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc

Issue 2378353002: [Merge-M54] Fix crash on item drag in shelf. (Closed)
Patch Set: Created 4 years, 3 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
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
index c44be122348eb76375e57cbec91625821bae69ce..8b9d74f60d54c6ec154e90f64f1a781dd2cf8c26 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -1168,7 +1168,7 @@ void ChromeLauncherControllerImpl::SyncPinPosition(ash::ShelfID shelf_id) {
DCHECK(!app_id.empty());
std::string app_id_before;
- std::string app_id_after;
+ std::vector<std::string> app_ids_after;
for (int i = index - 1; i > 0; --i) {
const ash::ShelfID shelf_id_before = model_->items()[i].id;
@@ -1182,13 +1182,13 @@ void ChromeLauncherControllerImpl::SyncPinPosition(ash::ShelfID shelf_id) {
for (int i = index + 1; i < max_index; ++i) {
const ash::ShelfID shelf_id_after = model_->items()[i].id;
if (IsPinned(shelf_id_after)) {
- app_id_after = GetAppIDForShelfID(shelf_id_after);
+ const std::string app_id_after = GetAppIDForShelfID(shelf_id_after);
DCHECK(!app_id_after.empty());
- break;
+ app_ids_after.push_back(app_id_after);
}
}
- ash::launcher::SetPinPosition(profile_, app_id, app_id_before, app_id_after);
+ ash::launcher::SetPinPosition(profile_, app_id, app_id_before, app_ids_after);
}
void ChromeLauncherControllerImpl::OnSyncModelUpdated() {

Powered by Google App Engine
This is Rietveld 408576698