Add new certificateProvider extension API.
[chromium-blink-merge.git] / chrome / browser / ui / app_list / model_pref_updater.h
blob702012b5d02763f2967e24487d2006e4aad9564d
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"
11 namespace app_list {
13 class AppListModel;
14 class AppListPrefs;
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 ~ModelPrefUpdater() override;
23 // Overridden from AppListModelObserver:
24 void OnAppListItemAdded(AppListItem* item) override;
25 void OnAppListItemWillBeDeleted(AppListItem* item) override;
26 void OnAppListItemUpdated(AppListItem* item) override;
28 private:
29 void UpdatePrefsFromAppListItem(AppListItem* item);
31 AppListPrefs* app_list_prefs_;
32 AppListModel* model_;
34 DISALLOW_COPY_AND_ASSIGN(ModelPrefUpdater);
37 } // namespace app_list
39 #endif // CHROME_BROWSER_UI_APP_LIST_MODEL_PREF_UPDATER_H_