OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ | 5 #ifndef ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
6 #define ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ | 6 #define ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/models/list_model_observer.h" | 9 #include "ui/base/models/list_model_observer.h" |
10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 | 30 |
31 void SetSelectedItem(AppListItemView* item); | 31 void SetSelectedItem(AppListItemView* item); |
32 void ClearSelectedItem(AppListItemView* item); | 32 void ClearSelectedItem(AppListItemView* item); |
33 | 33 |
34 private: | 34 private: |
35 // Updates from model. | 35 // Updates from model. |
36 void Update(); | 36 void Update(); |
37 | 37 |
38 AppListItemView* GetItemViewAtIndex(int index); | 38 AppListItemView* GetItemViewAtIndex(int index); |
39 void SetSelectedItemByIndex(int index); | 39 void SetSelectedItemByIndex(int index); |
40 int SetTileIconSizeAndGetMaxWidth(int icon_dimension); | |
41 | 40 |
42 // Overridden from views::View: | 41 // Overridden from views::View: |
43 virtual void Layout() OVERRIDE; | 42 virtual void Layout() OVERRIDE; |
44 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | 43 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
45 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; | 44 virtual bool OnKeyReleased(const views::KeyEvent& event) OVERRIDE; |
46 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; | 45 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE; |
47 | 46 |
48 // Overridden from ListModelObserver: | 47 // Overridden from ListModelObserver: |
49 virtual void ListItemsAdded(int start, int count) OVERRIDE; | 48 virtual void ListItemsAdded(int start, int count) OVERRIDE; |
50 virtual void ListItemsRemoved(int start, int count) OVERRIDE; | 49 virtual void ListItemsRemoved(int start, int count) OVERRIDE; |
51 virtual void ListItemsChanged(int start, int count) OVERRIDE; | 50 virtual void ListItemsChanged(int start, int count) OVERRIDE; |
52 | 51 |
53 AppListModel* model_; // Owned by parent AppListView. | 52 AppListModel* model_; // Owned by parent AppListView. |
54 views::ButtonListener* listener_; | 53 views::ButtonListener* listener_; |
55 | 54 |
56 int selected_item_index_; | 55 int selected_item_index_; |
57 int items_per_col_; | 56 int items_per_row_; |
58 | 57 |
59 DISALLOW_COPY_AND_ASSIGN(AppListModelView); | 58 DISALLOW_COPY_AND_ASSIGN(AppListModelView); |
60 }; | 59 }; |
61 | 60 |
62 } // namespace ash | 61 } // namespace ash |
63 | 62 |
64 #endif // ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ | 63 #endif // ASH_APP_LIST_APP_LIST_MODEL_VIEW_H_ |
OLD | NEW |