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

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: More revisions, remove unneeded function Created 5 years, 8 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 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 RemoveSyncItem(id); 483 RemoveSyncItem(id);
484 model_->DeleteItem(id); 484 model_->DeleteItem(id);
485 PruneEmptySyncFolders(); 485 PruneEmptySyncFolders();
486 } 486 }
487 487
488 void AppListSyncableService::RemoveUninstalledItem(const std::string& id) {
489 RemoveSyncItem(id);
490 model_->DeleteUninstalledItem(id);
491 PruneEmptySyncFolders();
492 }
493
488 void AppListSyncableService::UpdateItem(AppListItem* app_item) { 494 void AppListSyncableService::UpdateItem(AppListItem* app_item) {
489 // Check to see if the item needs to be moved to/from the OEM folder. 495 // Check to see if the item needs to be moved to/from the OEM folder.
490 if (!app_list::switches::IsFolderUIEnabled()) 496 if (!app_list::switches::IsFolderUIEnabled())
491 return; 497 return;
492 bool is_oem = AppIsOem(app_item->id()); 498 bool is_oem = AppIsOem(app_item->id());
493 if (!is_oem && app_item->folder_id() == kOemFolderId) 499 if (!is_oem && app_item->folder_id() == kOemFolderId)
494 model_->MoveItemToFolder(app_item, ""); 500 model_->MoveItemToFolder(app_item, "");
495 else if (is_oem && app_item->folder_id() != kOemFolderId) 501 else if (is_oem && app_item->folder_id() != kOemFolderId)
496 model_->MoveItemToFolder(app_item, kOemFolderId); 502 model_->MoveItemToFolder(app_item, kOemFolderId);
497 } 503 }
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } else { 1002 } else {
997 res += " { " + item_name + " }"; 1003 res += " { " + item_name + " }";
998 res += " [" + item_ordinal.ToDebugString() + "]"; 1004 res += " [" + item_ordinal.ToDebugString() + "]";
999 if (!parent_id.empty()) 1005 if (!parent_id.empty())
1000 res += " <" + parent_id.substr(0, 8) + ">"; 1006 res += " <" + parent_id.substr(0, 8) + ">";
1001 } 1007 }
1002 return res; 1008 return res;
1003 } 1009 }
1004 1010
1005 } // namespace app_list 1011 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service.h ('k') | chrome/browser/ui/app_list/extension_app_model_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698