Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: ash/app_list/app_list_model.h

Issue 9559005: aura: Implement app list M19 mock. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use a better way to get ceiling Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/app_list/app_list_item_view_listener.h ('k') | ash/app_list/app_list_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 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_H_ 5 #ifndef ASH_APP_LIST_APP_LIST_MODEL_H_
6 #define ASH_APP_LIST_APP_LIST_MODEL_H_ 6 #define ASH_APP_LIST_APP_LIST_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ash/app_list/app_list_item_group_model.h"
10 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ash/app_list/app_list_item_model.h"
11 #include "ash/ash_export.h" 11 #include "ash/ash_export.h"
12 #include "ui/base/models/list_model.h" 12 #include "ui/base/models/list_model.h"
13 13
14 namespace ash { 14 namespace ash {
15 15
16 // Model for AppListView. It is consisted of a list of AppListItemGroupModels, 16 class AppListItemModel;
17 // which in turn owns a list of AppListItemModels. 17
18 // Model for AppListModelView that owns a list of AppListItemModels.
18 class ASH_EXPORT AppListModel { 19 class ASH_EXPORT AppListModel {
19 public: 20 public:
20 AppListModel(); 21 AppListModel();
21 virtual ~AppListModel(); 22 virtual ~AppListModel();
22 23
23 void AddGroup(AppListItemGroupModel* group); 24 // Adds an item to the model. The model takes ownership of |item|.
24 AppListItemGroupModel* GetGroup(int index); 25 void AddItem(AppListItemModel* item);
26
27 AppListItemModel* GetItem(int index);
25 28
26 void AddObserver(ui::ListModelObserver* observer); 29 void AddObserver(ui::ListModelObserver* observer);
27 void RemoveObserver(ui::ListModelObserver* observer); 30 void RemoveObserver(ui::ListModelObserver* observer);
28 31
29 int group_count() const { 32 int item_count() const {
30 return groups_.item_count(); 33 return items_.item_count();
31 } 34 }
32 35
33 private: 36 private:
34 ui::ListModel<AppListItemGroupModel> groups_; 37 typedef ui::ListModel<AppListItemModel> Items;
38 Items items_;
35 39
36 DISALLOW_COPY_AND_ASSIGN(AppListModel); 40 DISALLOW_COPY_AND_ASSIGN(AppListModel);
37 }; 41 };
38 42
39 } // namespace ash 43 } // namespace ash
40 44
41 #endif // ASH_APP_LIST_APP_LIST_MODEL_H_ 45 #endif // ASH_APP_LIST_APP_LIST_MODEL_H_
OLDNEW
« no previous file with comments | « ash/app_list/app_list_item_view_listener.h ('k') | ash/app_list/app_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698