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

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

Issue 2316273004: [Merge-M53] arc: Don't sync app list change caused by Arc opt out. (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 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 <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
30 #include "sync/api/sync_merge_result.h" 30 #include "sync/api/sync_merge_result.h"
31 #include "sync/protocol/sync.pb.h" 31 #include "sync/protocol/sync.pb.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_model_builder.h" 44 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h"
44 #endif 45 #endif
45 46
46 using syncer::SyncChange; 47 using syncer::SyncChange;
47 48
48 namespace app_list { 49 namespace app_list {
49 50
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 } 213 }
213 214
214 void OnAppListItemWillBeDeleted(AppListItem* item) override { 215 void OnAppListItemWillBeDeleted(AppListItem* item) override {
215 DCHECK(!adding_item_); 216 DCHECK(!adding_item_);
216 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString(); 217 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString();
217 // Don't sync folder removal in case the folder still exists on another 218 // Don't sync folder removal in case the folder still exists on another
218 // device (e.g. with device specific items in it). Empty folders will be 219 // device (e.g. with device specific items in it). Empty folders will be
219 // deleted when the last item is removed (in PruneEmptySyncFolders()). 220 // deleted when the last item is removed (in PruneEmptySyncFolders()).
220 if (item->GetItemType() == AppListFolderItem::kItemType) 221 if (item->GetItemType() == AppListFolderItem::kItemType)
221 return; 222 return;
223
224 #if defined(OS_CHROMEOS)
225 if (item->GetItemType() == ArcAppItem::kItemType) {
226 // Don't sync remove changes coming as result of disabling Arc.
227 const arc::ArcAuthService* auth_service = arc::ArcAuthService::Get();
228 DCHECK(auth_service);
229 if (!auth_service->IsArcEnabled())
230 return;
231 }
232 #endif
233
222 owner_->RemoveSyncItem(item->id()); 234 owner_->RemoveSyncItem(item->id());
223 } 235 }
224 236
225 void OnAppListItemUpdated(AppListItem* item) override { 237 void OnAppListItemUpdated(AppListItem* item) override {
226 if (adding_item_) { 238 if (adding_item_) {
227 // Adding an item may trigger update notifications which should be 239 // Adding an item may trigger update notifications which should be
228 // ignored. 240 // ignored.
229 DCHECK_EQ(adding_item_, item); 241 DCHECK_EQ(adding_item_, item);
230 return; 242 return;
231 } 243 }
(...skipping 829 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 res += " { " + item_name + " }"; 1073 res += " { " + item_name + " }";
1062 res += " [" + item_ordinal.ToDebugString() + "]"; 1074 res += " [" + item_ordinal.ToDebugString() + "]";
1063 if (!parent_id.empty()) 1075 if (!parent_id.empty())
1064 res += " <" + parent_id.substr(0, 8) + ">"; 1076 res += " <" + parent_id.substr(0, 8) + ">";
1065 res += " [" + item_pin_ordinal.ToDebugString() + "]"; 1077 res += " [" + item_pin_ordinal.ToDebugString() + "]";
1066 } 1078 }
1067 return res; 1079 return res;
1068 } 1080 }
1069 1081
1070 } // namespace app_list 1082 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/app_list_model_builder.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_model_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698