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

Side by Side Diff: chrome/browser/ui/app_list/app_list_syncable_service.cc

Issue 1003393002: After uninstall, remove last item in Launcher folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" 5 #include "chrome/browser/ui/app_list/app_list_syncable_service.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "chrome/browser/apps/drive/drive_app_provider.h" 9 #include "chrome/browser/apps/drive/drive_app_provider.h"
10 #include "chrome/browser/chrome_notification_types.h" 10 #include "chrome/browser/chrome_notification_types.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 return; 472 return;
473 } 473 }
474 bool changed = UpdateSyncItemFromAppItem(app_item, sync_item); 474 bool changed = UpdateSyncItemFromAppItem(app_item, sync_item);
475 if (!changed) { 475 if (!changed) {
476 DVLOG(2) << this << " - Update: SYNC NO CHANGE: " << sync_item->ToString(); 476 DVLOG(2) << this << " - Update: SYNC NO CHANGE: " << sync_item->ToString();
477 return; 477 return;
478 } 478 }
479 SendSyncChange(sync_item, SyncChange::ACTION_UPDATE); 479 SendSyncChange(sync_item, SyncChange::ACTION_UPDATE);
480 } 480 }
481 481
482 void AppListSyncableService::RemoveItem(const std::string& id) { 482 void AppListSyncableService::RemoveItem(const std::string& id,
483 bool uninstalled) {
483 RemoveSyncItem(id); 484 RemoveSyncItem(id);
484 model_->DeleteItem(id); 485 if (uninstalled)
486 model_->DeleteUninstalledItem(id);
487 else
488 model_->DeleteItem(id);
485 PruneEmptySyncFolders(); 489 PruneEmptySyncFolders();
486 } 490 }
487 491
488 void AppListSyncableService::UpdateItem(AppListItem* app_item) { 492 void AppListSyncableService::UpdateItem(AppListItem* app_item) {
489 // Check to see if the item needs to be moved to/from the OEM folder. 493 // Check to see if the item needs to be moved to/from the OEM folder.
490 if (!app_list::switches::IsFolderUIEnabled()) 494 if (!app_list::switches::IsFolderUIEnabled())
491 return; 495 return;
492 bool is_oem = AppIsOem(app_item->id()); 496 bool is_oem = AppIsOem(app_item->id());
493 if (!is_oem && app_item->folder_id() == kOemFolderId) 497 if (!is_oem && app_item->folder_id() == kOemFolderId)
494 model_->MoveItemToFolder(app_item, ""); 498 model_->MoveItemToFolder(app_item, "");
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } else { 1000 } else {
997 res += " { " + item_name + " }"; 1001 res += " { " + item_name + " }";
998 res += " [" + item_ordinal.ToDebugString() + "]"; 1002 res += " [" + item_ordinal.ToDebugString() + "]";
999 if (!parent_id.empty()) 1003 if (!parent_id.empty())
1000 res += " <" + parent_id.substr(0, 8) + ">"; 1004 res += " <" + parent_id.substr(0, 8) + ">";
1001 } 1005 }
1002 return res; 1006 return res;
1003 } 1007 }
1004 1008
1005 } // namespace app_list 1009 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698