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" | 7 #include "ui/app_list/app_list_item_model.h" |
| 8 #include "ui/app_list/app_list_model_observer.h" |
8 #include "ui/app_list/search_box_model.h" | 9 #include "ui/app_list/search_box_model.h" |
9 #include "ui/app_list/search_result.h" | 10 #include "ui/app_list/search_result.h" |
10 | 11 |
11 namespace app_list { | 12 namespace app_list { |
12 | 13 |
13 AppListModel::AppListModel() | 14 AppListModel::AppListModel() |
14 : apps_(new Apps), | 15 : apps_(new Apps), |
15 search_box_(new SearchBoxModel), | 16 search_box_(new SearchBoxModel), |
16 results_(new SearchResults) { | 17 results_(new SearchResults), |
| 18 status_(STATUS_NORMAL) { |
17 } | 19 } |
18 | 20 |
19 AppListModel::~AppListModel() { | 21 AppListModel::~AppListModel() { |
20 } | 22 } |
21 | 23 |
| 24 void AppListModel::AddObserver(AppListModelObserver* observer) { |
| 25 observers_.AddObserver(observer); |
| 26 } |
| 27 |
| 28 void AppListModel::RemoveObserver(AppListModelObserver* observer) { |
| 29 observers_.RemoveObserver(observer); |
| 30 } |
| 31 |
| 32 void AppListModel::SetStatus(Status status) { |
| 33 if (status_ == status) |
| 34 return; |
| 35 |
| 36 status_ = status; |
| 37 FOR_EACH_OBSERVER(AppListModelObserver, |
| 38 observers_, |
| 39 OnAppListModelStatusChanged()); |
| 40 } |
| 41 |
22 } // namespace app_list | 42 } // namespace app_list |
OLD | NEW |