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.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_
8 #include "base/macros.h"
9 #include "ui/app_list/app_list_model_observer.h"
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
{
20 ModelPrefUpdater(AppListPrefs
* app_list_prefs
, AppListModel
* model
);
21 ~ModelPrefUpdater() override
;
23 // Overridden from AppListModelObserver:
24 void OnAppListItemAdded(AppListItem
* item
) override
;
25 void OnAppListItemWillBeDeleted(AppListItem
* item
) override
;
26 void OnAppListItemUpdated(AppListItem
* item
) override
;
29 void UpdatePrefsFromAppListItem(AppListItem
* item
);
31 AppListPrefs
* app_list_prefs_
;
34 DISALLOW_COPY_AND_ASSIGN(ModelPrefUpdater
);
37 } // namespace app_list
39 #endif // CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_