OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 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 <string> |
| 10 #include <vector> |
| 11 |
| 12 #include "ash/ash_export.h" |
| 13 #include "ui/base/models/list_model_observer.h" |
| 14 #include "ui/views/controls/button/button.h" |
| 15 #include "ui/views/view.h" |
| 16 |
| 17 namespace views { |
| 18 class BoundsAnimator; |
| 19 } |
| 20 |
| 21 namespace ash { |
| 22 |
| 23 class AppListModel; |
| 24 |
| 25 // AppListModelView displays the UI for an AppListModel. |
| 26 class ASH_EXPORT AppListModelView : public views::View, |
| 27 public ui::ListModelObserver { |
| 28 public: |
| 29 AppListModelView(AppListModel* model, |
| 30 views::ButtonListener* listener); |
| 31 virtual ~AppListModelView(); |
| 32 |
| 33 private: |
| 34 // Updates from model. |
| 35 void Update(); |
| 36 |
| 37 // Sets focused tile by index. |
| 38 void SetFocusedTileByIndex(int index); |
| 39 |
| 40 // Overridden from views::View: |
| 41 virtual void Layout() OVERRIDE; |
| 42 |
| 43 // Overridden from ListModelObserver: |
| 44 virtual void ListItemsAdded(int start, int count) OVERRIDE; |
| 45 virtual void ListItemsRemoved(int start, int count) OVERRIDE; |
| 46 virtual void ListItemsChanged(int start, int count) OVERRIDE; |
| 47 |
| 48 AppListModel* model_; // Owned by parent AppListView. |
| 49 views::ButtonListener* listener_; |
| 50 |
| 51 DISALLOW_COPY_AND_ASSIGN(AppListModelView); |
| 52 }; |
| 53 |
| 54 } // namespace ash |
| 55 |
| 56 #endif // ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
OLD | NEW |