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

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

Issue 10408009: ui: Change ListModel to operate in size_t instead of int. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix unittest Created 8 years, 7 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
OLDNEW
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 UI_APP_LIST_APP_LIST_MODEL_H_ 5 #ifndef UI_APP_LIST_APP_LIST_MODEL_H_
6 #define UI_APP_LIST_APP_LIST_MODEL_H_ 6 #define UI_APP_LIST_APP_LIST_MODEL_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/app_list/app_list_export.h" 10 #include "ui/app_list/app_list_export.h"
11 #include "ui/app_list/app_list_item_model.h" 11 #include "ui/app_list/app_list_item_model.h"
12 #include "ui/base/models/list_model.h" 12 #include "ui/base/models/list_model.h"
13 13
14 namespace app_list { 14 namespace app_list {
15 15
16 // Model for AppListModelView that owns a list of AppListItemModel. 16 // Model for AppListModelView that owns a list of AppListItemModel.
17 class APP_LIST_EXPORT AppListModel { 17 class APP_LIST_EXPORT AppListModel {
18 public: 18 public:
19 AppListModel(); 19 AppListModel();
20 ~AppListModel(); 20 ~AppListModel();
21 21
22 // Adds an item to the model. The model takes ownership of |item|. 22 // Adds an item to the model. The model takes ownership of |item|.
23 void AddItem(AppListItemModel* item); 23 void AddItem(AppListItemModel* item);
24 void AddItemAt(int index, AppListItemModel* item); 24 void AddItemAt(size_t index, AppListItemModel* item);
25 25
26 void DeleteItemAt(int index); 26 void DeleteItemAt(size_t index);
27 27
28 AppListItemModel* GetItemAt(int index); 28 AppListItemModel* GetItemAt(size_t index);
29 29
30 void AddObserver(ui::ListModelObserver* observer); 30 void AddObserver(ui::ListModelObserver* observer);
31 void RemoveObserver(ui::ListModelObserver* observer); 31 void RemoveObserver(ui::ListModelObserver* observer);
32 32
33 int item_count() const { return items_.item_count(); } 33 size_t item_count() const { return items_.item_count(); }
34 34
35 private: 35 private:
36 typedef ui::ListModel<AppListItemModel> Items; 36 typedef ui::ListModel<AppListItemModel> Items;
37 Items items_; 37 Items items_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(AppListModel); 39 DISALLOW_COPY_AND_ASSIGN(AppListModel);
40 }; 40 };
41 41
42 } // namespace app_list 42 } // namespace app_list
43 43
44 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ 44 #endif // UI_APP_LIST_APP_LIST_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/app_list/app_list_model_builder_unittest.cc ('k') | ui/app_list/app_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698