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

Unified Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc

Issue 2655563002: [Merge M56] Fix import legacy, pref based pins. (Closed)
Patch Set: Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
index 2aaaf707ea975ed3af61ddcc8c004f0a21276efb..e5bff0ff71b207b2361b60fdf287a145f82eb330 100644
--- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
+++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_impl.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/extensions/extension_util.h"
#include "chrome/browser/extensions/launch_util.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
+#include "chrome/browser/prefs/pref_service_syncable_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h"
@@ -76,6 +77,7 @@
#include "components/prefs/scoped_user_pref_update.h"
#include "components/signin/core/account_id/account_id.h"
#include "components/strings/grit/components_strings.h"
+#include "components/sync_preferences/pref_service_syncable.h"
#include "components/user_manager/user_manager.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/web_contents.h"
@@ -893,6 +895,8 @@ void ChromeLauncherControllerImpl::AttachProfile(Profile* profile_to_attach) {
app_list::AppListSyncableServiceFactory::GetForProfile(profile());
if (app_service)
app_service->AddObserverAndStart(this);
+
+ PrefServiceSyncableFromProfile(profile())->AddObserver(this);
}
///////////////////////////////////////////////////////////////////////////////
@@ -1200,6 +1204,10 @@ void ChromeLauncherControllerImpl::OnSyncModelUpdated() {
UpdateAppLaunchersFromPref();
}
+void ChromeLauncherControllerImpl::OnIsSyncingChanged() {
+ UpdateAppLaunchersFromPref();
+}
+
void ChromeLauncherControllerImpl::ScheduleUpdateAppLaunchersFromPref() {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
@@ -1468,6 +1476,8 @@ void ChromeLauncherControllerImpl::ReleaseProfile() {
app_list::AppListSyncableServiceFactory::GetForProfile(profile());
if (app_service)
app_service->RemoveObserver(this);
+
+ PrefServiceSyncableFromProfile(profile())->RemoveObserver(this);
}
///////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698