| OLD | NEW |
| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "extensions/browser/uninstall_reason.h" | 30 #include "extensions/browser/uninstall_reason.h" |
| 31 #include "extensions/common/constants.h" | 31 #include "extensions/common/constants.h" |
| 32 #include "ui/app_list/app_list_folder_item.h" | 32 #include "ui/app_list/app_list_folder_item.h" |
| 33 #include "ui/app_list/app_list_item.h" | 33 #include "ui/app_list/app_list_item.h" |
| 34 #include "ui/app_list/app_list_model.h" | 34 #include "ui/app_list/app_list_model.h" |
| 35 #include "ui/app_list/app_list_model_observer.h" | 35 #include "ui/app_list/app_list_model_observer.h" |
| 36 #include "ui/app_list/app_list_switches.h" | 36 #include "ui/app_list/app_list_switches.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 | 38 |
| 39 #if defined(OS_CHROMEOS) | 39 #if defined(OS_CHROMEOS) |
| 40 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 40 #include "chrome/browser/chromeos/file_manager/app_id.h" | 41 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 41 #include "chrome/browser/chromeos/genius_app/app_id.h" | 42 #include "chrome/browser/chromeos/genius_app/app_id.h" |
| 42 #include "chrome/browser/ui/app_list/arc/arc_app_item.h" | 43 #include "chrome/browser/ui/app_list/arc/arc_app_item.h" |
| 43 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" | 44 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" |
| 44 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h" | 45 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h" |
| 45 #endif | 46 #endif |
| 46 | 47 |
| 47 using syncer::SyncChange; | 48 using syncer::SyncChange; |
| 48 | 49 |
| 49 namespace app_list { | 50 namespace app_list { |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 } | 214 } |
| 214 | 215 |
| 215 void OnAppListItemWillBeDeleted(AppListItem* item) override { | 216 void OnAppListItemWillBeDeleted(AppListItem* item) override { |
| 216 DCHECK(!adding_item_); | 217 DCHECK(!adding_item_); |
| 217 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString(); | 218 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString(); |
| 218 // Don't sync folder removal in case the folder still exists on another | 219 // Don't sync folder removal in case the folder still exists on another |
| 219 // device (e.g. with device specific items in it). Empty folders will be | 220 // device (e.g. with device specific items in it). Empty folders will be |
| 220 // deleted when the last item is removed (in PruneEmptySyncFolders()). | 221 // deleted when the last item is removed (in PruneEmptySyncFolders()). |
| 221 if (item->GetItemType() == AppListFolderItem::kItemType) | 222 if (item->GetItemType() == AppListFolderItem::kItemType) |
| 222 return; | 223 return; |
| 224 |
| 225 #if defined(OS_CHROMEOS) |
| 226 if (item->GetItemType() == ArcAppItem::kItemType) { |
| 227 // Don't sync remove changes coming as result of disabling Arc. |
| 228 const arc::ArcAuthService* auth_service = arc::ArcAuthService::Get(); |
| 229 DCHECK(auth_service); |
| 230 if (!auth_service->IsArcEnabled()) |
| 231 return; |
| 232 } |
| 233 #endif |
| 234 |
| 223 owner_->RemoveSyncItem(item->id()); | 235 owner_->RemoveSyncItem(item->id()); |
| 224 } | 236 } |
| 225 | 237 |
| 226 void OnAppListItemUpdated(AppListItem* item) override { | 238 void OnAppListItemUpdated(AppListItem* item) override { |
| 227 if (adding_item_) { | 239 if (adding_item_) { |
| 228 // Adding an item may trigger update notifications which should be | 240 // Adding an item may trigger update notifications which should be |
| 229 // ignored. | 241 // ignored. |
| 230 DCHECK_EQ(adding_item_, item); | 242 DCHECK_EQ(adding_item_, item); |
| 231 return; | 243 return; |
| 232 } | 244 } |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1069 res += " { " + item_name + " }"; | 1081 res += " { " + item_name + " }"; |
| 1070 res += " [" + item_ordinal.ToDebugString() + "]"; | 1082 res += " [" + item_ordinal.ToDebugString() + "]"; |
| 1071 if (!parent_id.empty()) | 1083 if (!parent_id.empty()) |
| 1072 res += " <" + parent_id.substr(0, 8) + ">"; | 1084 res += " <" + parent_id.substr(0, 8) + ">"; |
| 1073 res += " [" + item_pin_ordinal.ToDebugString() + "]"; | 1085 res += " [" + item_pin_ordinal.ToDebugString() + "]"; |
| 1074 } | 1086 } |
| 1075 return res; | 1087 return res; |
| 1076 } | 1088 } |
| 1077 | 1089 |
| 1078 } // namespace app_list | 1090 } // namespace app_list |
| OLD | NEW |