Chromium Code Reviews| 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/app_list_model_observer.h" |
| 9 #include "ui/app_list/search_box_model.h" | 9 #include "ui/app_list/search_box_model.h" |
| 10 #include "ui/app_list/search_result.h" | 10 #include "ui/app_list/search_result.h" |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 void AppListModel::SetStatus(Status status) { | 33 void AppListModel::SetStatus(Status status) { |
| 34 if (status_ == status) | 34 if (status_ == status) |
| 35 return; | 35 return; |
| 36 | 36 |
| 37 status_ = status; | 37 status_ = status; |
| 38 FOR_EACH_OBSERVER(AppListModelObserver, | 38 FOR_EACH_OBSERVER(AppListModelObserver, |
| 39 observers_, | 39 observers_, |
| 40 OnAppListModelStatusChanged()); | 40 OnAppListModelStatusChanged()); |
| 41 } | 41 } |
| 42 | 42 |
| 43 void AppListModel::SetCurrentUser(const base::string16& current_user_name, | 43 void AppListModel::SetUsers(const Users& users) { |
| 44 const base::string16& current_user_email) { | 44 users_ = users; |
| 45 if (current_user_name_ == current_user_name && | |
| 46 current_user_email_ == current_user_email) { | |
| 47 return; | |
| 48 } | |
| 49 current_user_name_ = current_user_name; | |
| 50 current_user_email_ = current_user_email; | |
| 51 FOR_EACH_OBSERVER(AppListModelObserver, | 45 FOR_EACH_OBSERVER(AppListModelObserver, |
| 52 observers_, | 46 observers_, |
| 53 OnAppListModelCurrentUserChanged()); | 47 OnAppListModelUsersChanged()); |
| 54 } | 48 } |
| 55 | 49 |
| 56 void AppListModel::SetSignedIn(bool signed_in) { | 50 void AppListModel::SetSignedIn(bool signed_in) { |
| 57 if (signed_in_ == signed_in) | 51 if (signed_in_ == signed_in) |
| 58 return; | 52 return; |
| 59 | 53 |
| 60 signed_in_ = signed_in; | 54 signed_in_ = signed_in; |
| 61 FOR_EACH_OBSERVER(AppListModelObserver, | 55 FOR_EACH_OBSERVER(AppListModelObserver, |
| 62 observers_, | 56 observers_, |
| 63 OnAppListModelSigninStatusChanged()); | 57 OnAppListModelSigninStatusChanged()); |
| 64 } | 58 } |
| 65 | 59 |
| 60 AppListModel::User::User() : active(false) { | |
|
tapted
2013/09/11 05:50:26
nit: move these to the top to match declaration or
calamity
2013/09/13 18:02:35
Done.
| |
| 61 } | |
| 62 | |
| 63 AppListModel::User::~User() { | |
| 64 } | |
| 65 | |
| 66 } // namespace app_list | 66 } // namespace app_list |
| OLD | NEW |