| 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 #include "ui/app_list/app_list_model.h" | 5 #include "ui/app_list/app_list_model.h" |
| 6 | 6 |
| 7 #include "ui/app_list/app_list_item_model.h" |
| 8 #include "ui/app_list/search_box_model.h" |
| 9 #include "ui/app_list/search_result.h" |
| 10 |
| 7 namespace app_list { | 11 namespace app_list { |
| 8 | 12 |
| 9 AppListModel::AppListModel() { | 13 AppListModel::AppListModel() |
| 14 : apps_(new Apps), |
| 15 search_box_(new SearchBoxModel), |
| 16 results_(new SearchResults) { |
| 10 } | 17 } |
| 11 | 18 |
| 12 AppListModel::~AppListModel() { | 19 AppListModel::~AppListModel() { |
| 13 } | 20 } |
| 14 | 21 |
| 15 void AppListModel::AddItem(AppListItemModel* item) { | |
| 16 items_.Add(item); | |
| 17 } | |
| 18 | |
| 19 void AppListModel::AddItemAt(size_t index, AppListItemModel* item) { | |
| 20 items_.AddAt(index, item); | |
| 21 } | |
| 22 | |
| 23 void AppListModel::DeleteItemAt(size_t index) { | |
| 24 items_.DeleteAt(index); | |
| 25 } | |
| 26 | |
| 27 AppListItemModel* AppListModel::GetItemAt(size_t index) { | |
| 28 return items_.GetItemAt(index); | |
| 29 } | |
| 30 | |
| 31 void AppListModel::AddObserver(ui::ListModelObserver* observer) { | |
| 32 items_.AddObserver(observer); | |
| 33 } | |
| 34 | |
| 35 void AppListModel::RemoveObserver(ui::ListModelObserver* observer) { | |
| 36 items_.RemoveObserver(observer); | |
| 37 } | |
| 38 | |
| 39 } // namespace app_list | 22 } // namespace app_list |
| OLD | NEW |