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

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

Issue 2702723002: Extract kArcEnabled preference from ArcSessionManager part 1. (Closed)
Patch Set: Address comments. Created 3 years, 10 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 22 matching lines...) Expand all
33 #include "extensions/common/constants.h" 33 #include "extensions/common/constants.h"
34 #include "extensions/common/one_shot_event.h" 34 #include "extensions/common/one_shot_event.h"
35 #include "ui/app_list/app_list_folder_item.h" 35 #include "ui/app_list/app_list_folder_item.h"
36 #include "ui/app_list/app_list_item.h" 36 #include "ui/app_list/app_list_item.h"
37 #include "ui/app_list/app_list_model.h" 37 #include "ui/app_list/app_list_model.h"
38 #include "ui/app_list/app_list_model_observer.h" 38 #include "ui/app_list/app_list_model_observer.h"
39 #include "ui/app_list/app_list_switches.h" 39 #include "ui/app_list/app_list_switches.h"
40 #include "ui/base/l10n/l10n_util.h" 40 #include "ui/base/l10n/l10n_util.h"
41 41
42 #if defined(OS_CHROMEOS) 42 #if defined(OS_CHROMEOS)
43 #include "chrome/browser/chromeos/arc/arc_session_manager.h"
44 #include "chrome/browser/chromeos/arc/arc_util.h" 43 #include "chrome/browser/chromeos/arc/arc_util.h"
45 #include "chrome/browser/chromeos/file_manager/app_id.h" 44 #include "chrome/browser/chromeos/file_manager/app_id.h"
46 #include "chrome/browser/chromeos/genius_app/app_id.h" 45 #include "chrome/browser/chromeos/genius_app/app_id.h"
47 #include "chrome/browser/ui/app_list/arc/arc_app_item.h" 46 #include "chrome/browser/ui/app_list/arc/arc_app_item.h"
48 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h" 47 #include "chrome/browser/ui/app_list/arc/arc_app_list_prefs.h"
49 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h" 48 #include "chrome/browser/ui/app_list/arc/arc_app_model_builder.h"
50 #endif 49 #endif
51 50
52 using syncer::SyncChange; 51 using syncer::SyncChange;
53 52
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString(); 254 VLOG(2) << owner_ << " OnAppListItemDeleted: " << item->ToDebugString();
256 // Don't sync folder removal in case the folder still exists on another 255 // Don't sync folder removal in case the folder still exists on another
257 // device (e.g. with device specific items in it). Empty folders will be 256 // device (e.g. with device specific items in it). Empty folders will be
258 // deleted when the last item is removed (in PruneEmptySyncFolders()). 257 // deleted when the last item is removed (in PruneEmptySyncFolders()).
259 if (item->GetItemType() == AppListFolderItem::kItemType) 258 if (item->GetItemType() == AppListFolderItem::kItemType)
260 return; 259 return;
261 260
262 #if defined(OS_CHROMEOS) 261 #if defined(OS_CHROMEOS)
263 if (item->GetItemType() == ArcAppItem::kItemType) { 262 if (item->GetItemType() == ArcAppItem::kItemType) {
264 // Don't sync remove changes coming as result of disabling ARC. 263 // Don't sync remove changes coming as result of disabling ARC.
265 const arc::ArcSessionManager* arc_session_manager = 264 if (!arc::IsArcPlayStoreEnabledForProfile(owner_->profile()))
266 arc::ArcSessionManager::Get();
267 DCHECK(arc_session_manager);
268 if (!arc_session_manager->IsArcPlayStoreEnabled())
269 return; 265 return;
270 } 266 }
271 #endif 267 #endif
272 268
273 owner_->RemoveSyncItem(item->id()); 269 owner_->RemoveSyncItem(item->id());
274 } 270 }
275 271
276 void OnAppListItemUpdated(AppListItem* item) override { 272 void OnAppListItemUpdated(AppListItem* item) override {
277 if (adding_item_) { 273 if (adding_item_) {
278 // Adding an item may trigger update notifications which should be 274 // Adding an item may trigger update notifications which should be
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 res += " { " + item_name + " }"; 1225 res += " { " + item_name + " }";
1230 res += " [" + item_ordinal.ToDebugString() + "]"; 1226 res += " [" + item_ordinal.ToDebugString() + "]";
1231 if (!parent_id.empty()) 1227 if (!parent_id.empty())
1232 res += " <" + parent_id.substr(0, 8) + ">"; 1228 res += " <" + parent_id.substr(0, 8) + ">";
1233 res += " [" + item_pin_ordinal.ToDebugString() + "]"; 1229 res += " [" + item_pin_ordinal.ToDebugString() + "]";
1234 } 1230 }
1235 return res; 1231 return res;
1236 } 1232 }
1237 1233
1238 } // namespace app_list 1234 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/sync_arc_package_helper.cc ('k') | chrome/browser/ui/app_list/arc/arc_app_list_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698