OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_ |
| 6 #define CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "ui/app_list/app_list_model_observer.h" |
| 10 |
| 11 namespace app_list { |
| 12 |
| 13 class AppListModel; |
| 14 class AppListPrefs; |
| 15 |
| 16 // A class which listens to an AppListModel and updates the local pref model of |
| 17 // the app list accordingly. |
| 18 class ModelPrefUpdater : public AppListModelObserver { |
| 19 public: |
| 20 ModelPrefUpdater(AppListPrefs* app_list_prefs, AppListModel* model); |
| 21 virtual ~ModelPrefUpdater(); |
| 22 |
| 23 // Overridden from AppListModelObserver: |
| 24 virtual void OnAppListItemAdded(AppListItem* item) OVERRIDE; |
| 25 virtual void OnAppListItemWillBeDeleted(AppListItem* item) OVERRIDE; |
| 26 virtual void OnAppListItemUpdated(AppListItem* item) OVERRIDE; |
| 27 |
| 28 private: |
| 29 void UpdatePrefsFromAppListItem(AppListItem* item); |
| 30 |
| 31 AppListPrefs* app_list_prefs_; |
| 32 AppListModel* model_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(ModelPrefUpdater); |
| 35 }; |
| 36 |
| 37 } // namespace app_list |
| 38 |
| 39 #endif // CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_ |
OLD | NEW |