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

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

Issue 2352353002: Add AppLauncherId wrapper for items shown in shelf (Closed)
Patch Set: Rebase 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 67762c1708c30f1ad2f1f3c078be21d2353a36ef..e99a9e602df80f3bb7a473addaf1c432f36b6802 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -393,7 +393,8 @@ void ChromeLauncherControllerImpl::UnpinAndUpdatePrefs(ash::ShelfID id,
CHECK(controller);
if (update_prefs)
- ash::launcher::RemovePinPosition(profile_, GetAppIDForShelfID(id));
+ ash::launcher::RemovePinPosition(
+ profile_, ash::launcher::AppLauncherId(GetAppIDForShelfID(id)));
stevenjb 2016/09/27 16:42:36 {} around multi-line if bodies.
Andra Paraschiv 2016/10/03 15:53:02 Done.
if (controller->type() == LauncherItemController::TYPE_APP ||
controller->locked()) {
@@ -1177,7 +1178,8 @@ void ChromeLauncherControllerImpl::SyncPinPosition(ash::ShelfID shelf_id) {
DCHECK(!app_id.empty());
std::string app_id_before;
- std::vector<std::string> app_ids_after;
+ std::vector<std::unique_ptr<ash::launcher::AppLauncherId>>
+ app_launcher_ids_after;
for (int i = index - 1; i > 0; --i) {
const ash::ShelfID shelf_id_before = model_->items()[i].id;
@@ -1193,11 +1195,15 @@ void ChromeLauncherControllerImpl::SyncPinPosition(ash::ShelfID shelf_id) {
if (IsPinned(shelf_id_after)) {
const std::string app_id_after = GetAppIDForShelfID(shelf_id_after);
DCHECK(!app_id_after.empty());
- app_ids_after.push_back(app_id_after);
+ app_launcher_ids_after.push_back(
+ std::unique_ptr<ash::launcher::AppLauncherId>(
+ new ash::launcher::AppLauncherId(app_id_after)));
stevenjb 2016/09/27 16:42:36 app_launcher_ids_after.push_back(base::MakeUnique<
Andra Paraschiv 2016/10/03 15:53:02 Done.
}
}
- ash::launcher::SetPinPosition(profile_, app_id, app_id_before, app_ids_after);
+ ash::launcher::SetPinPosition(profile_, ash::launcher::AppLauncherId(app_id),
+ ash::launcher::AppLauncherId(app_id_before),
+ app_launcher_ids_after);
}
void ChromeLauncherControllerImpl::OnSyncModelUpdated() {

Powered by Google App Engine
This is Rietveld 408576698