OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 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 ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
| 6 #define ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "ui/base/models/list_model_observer.h" |
| 10 #include "ui/views/view.h" |
| 11 |
| 12 namespace views { |
| 13 class ButtonListener; |
| 14 } |
| 15 |
| 16 namespace ash { |
| 17 |
| 18 class AppListModel; |
| 19 |
| 20 // AppListModelView displays the UI for an AppListModel. |
| 21 class AppListModelView : public views::View, |
| 22 public ui::ListModelObserver { |
| 23 public: |
| 24 explicit AppListModelView(views::ButtonListener* listener); |
| 25 virtual ~AppListModelView(); |
| 26 |
| 27 // Sets |model| to use. Note this does not take ownership of |model|. |
| 28 void SetModel(AppListModel* model); |
| 29 |
| 30 private: |
| 31 // Updates from model. |
| 32 void Update(); |
| 33 |
| 34 // Overridden from views::View: |
| 35 virtual void Layout() OVERRIDE; |
| 36 |
| 37 // Overridden from ListModelObserver: |
| 38 virtual void ListItemsAdded(int start, int count) OVERRIDE; |
| 39 virtual void ListItemsRemoved(int start, int count) OVERRIDE; |
| 40 virtual void ListItemsChanged(int start, int count) OVERRIDE; |
| 41 |
| 42 AppListModel* model_; // Owned by parent AppListView. |
| 43 views::ButtonListener* listener_; |
| 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(AppListModelView); |
| 46 }; |
| 47 |
| 48 } // namespace ash |
| 49 |
| 50 #endif // ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
OLD | NEW |