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

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

Issue 599343002: Mirror app list hierarchy data in profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@app_list_folder_pref
Patch Set: add unit test Created 6 years, 2 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 "chrome/browser/apps/drive/drive_app_provider.h" 8 #include "chrome/browser/apps/drive/drive_app_provider.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
11 #include "chrome/browser/profiles/profile.h" 11 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/app_list/app_list_prefs.h"
12 #include "chrome/browser/ui/app_list/app_list_service.h" 13 #include "chrome/browser/ui/app_list/app_list_service.h"
13 #include "chrome/browser/ui/app_list/extension_app_item.h" 14 #include "chrome/browser/ui/app_list/extension_app_item.h"
14 #include "chrome/browser/ui/app_list/extension_app_model_builder.h" 15 #include "chrome/browser/ui/app_list/extension_app_model_builder.h"
16 #include "chrome/browser/ui/app_list/model_pref_updater.h"
15 #include "chrome/browser/ui/host_desktop.h" 17 #include "chrome/browser/ui/host_desktop.h"
16 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
17 #include "chrome/common/extensions/extension_constants.h" 19 #include "chrome/common/extensions/extension_constants.h"
18 #include "chrome/grit/generated_resources.h" 20 #include "chrome/grit/generated_resources.h"
19 #include "content/public/browser/notification_source.h" 21 #include "content/public/browser/notification_source.h"
20 #include "extensions/browser/extension_prefs.h" 22 #include "extensions/browser/extension_prefs.h"
21 #include "extensions/browser/extension_system.h" 23 #include "extensions/browser/extension_system.h"
22 #include "extensions/browser/uninstall_reason.h" 24 #include "extensions/browser/uninstall_reason.h"
23 #include "extensions/common/constants.h" 25 #include "extensions/common/constants.h"
24 #include "sync/api/sync_change_processor.h" 26 #include "sync/api/sync_change_processor.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 DCHECK(profile_); 259 DCHECK(profile_);
258 if (app_list::switches::IsAppListSyncEnabled()) { 260 if (app_list::switches::IsAppListSyncEnabled()) {
259 VLOG(1) << this << ": AppListSyncableService: InitializeWithService."; 261 VLOG(1) << this << ": AppListSyncableService: InitializeWithService.";
260 SyncStarted(); 262 SyncStarted();
261 apps_builder_->InitializeWithService(this); 263 apps_builder_->InitializeWithService(this);
262 } else { 264 } else {
263 VLOG(1) << this << ": AppListSyncableService: InitializeWithProfile."; 265 VLOG(1) << this << ": AppListSyncableService: InitializeWithProfile.";
264 apps_builder_->InitializeWithProfile(profile_, model_.get()); 266 apps_builder_->InitializeWithProfile(profile_, model_.get());
265 } 267 }
266 268
269 model_pref_updater_.reset(
270 new ModelPrefUpdater(AppListPrefs::Get(profile_), model_.get()));
271
267 if (app_list::switches::IsDriveAppsInAppListEnabled()) 272 if (app_list::switches::IsDriveAppsInAppListEnabled())
268 drive_app_provider_.reset(new DriveAppProvider(profile_)); 273 drive_app_provider_.reset(new DriveAppProvider(profile_));
269 } 274 }
270 275
271 void AppListSyncableService::ResetDriveAppProviderForTest() { 276 void AppListSyncableService::ResetDriveAppProviderForTest() {
272 drive_app_provider_.reset(); 277 drive_app_provider_.reset();
273 } 278 }
274 279
275 void AppListSyncableService::Shutdown() { 280 void AppListSyncableService::Shutdown() {
276 // DriveAppProvider touches other KeyedServices in its dtor and needs be 281 // DriveAppProvider touches other KeyedServices in its dtor and needs be
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
925 } else { 930 } else {
926 res += " { " + item_name + " }"; 931 res += " { " + item_name + " }";
927 res += " [" + item_ordinal.ToDebugString() + "]"; 932 res += " [" + item_ordinal.ToDebugString() + "]";
928 if (!parent_id.empty()) 933 if (!parent_id.empty())
929 res += " <" + parent_id.substr(0, 8) + ">"; 934 res += " <" + parent_id.substr(0, 8) + ">";
930 } 935 }
931 return res; 936 return res;
932 } 937 }
933 938
934 } // namespace app_list 939 } // 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/model_pref_updater.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698