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

Unified Diff: chrome/browser/ui/app_list/model_pref_updater.h

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/app_list/model_pref_updater.h
diff --git a/chrome/browser/ui/app_list/model_pref_updater.h b/chrome/browser/ui/app_list/model_pref_updater.h
new file mode 100644
index 0000000000000000000000000000000000000000..6ff16163d3fd8549ad8da5c6f2971814561b4ae1
--- /dev/null
+++ b/chrome/browser/ui/app_list/model_pref_updater.h
@@ -0,0 +1,39 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_
+#define CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_
+
+#include "base/macros.h"
+#include "ui/app_list/app_list_model_observer.h"
+
+namespace app_list {
+
+class AppListModel;
+class AppListPrefs;
+
+// A class which listens to an AppListModel and updates the local pref model of
+// the app list accordingly.
+class ModelPrefUpdater : public AppListModelObserver {
+ public:
+ ModelPrefUpdater(AppListPrefs* app_list_prefs, AppListModel* model);
+ virtual ~ModelPrefUpdater();
+
+ // Overridden from AppListModelObserver:
+ virtual void OnAppListItemAdded(AppListItem* item) OVERRIDE;
+ virtual void OnAppListItemWillBeDeleted(AppListItem* item) OVERRIDE;
+ virtual void OnAppListItemUpdated(AppListItem* item) OVERRIDE;
+
+ private:
+ void UpdatePrefsFromAppListItem(AppListItem* item);
+
+ AppListPrefs* app_list_prefs_;
+ AppListModel* model_;
+
+ DISALLOW_COPY_AND_ASSIGN(ModelPrefUpdater);
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service.cc ('k') | chrome/browser/ui/app_list/model_pref_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698