| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/test/app_list_test_model.h" | 5 #include "ui/app_list/test/app_list_test_model.h" |
| 6 | 6 |
| 7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
| 8 #include "ui/app_list/app_list_item_model.h" | 8 #include "ui/app_list/app_list_item_model.h" |
| 9 | 9 |
| 10 namespace app_list { | 10 namespace app_list { |
| 11 namespace test { | 11 namespace test { |
| 12 | 12 |
| 13 AppListTestModel::AppListTestModel() { |
| 14 SetSignedIn(true); |
| 15 } |
| 16 |
| 13 void AppListTestModel::PopulateApps(int n) { | 17 void AppListTestModel::PopulateApps(int n) { |
| 14 for (int i = 0; i < n; ++i) | 18 for (int i = 0; i < n; ++i) |
| 15 AddItem(base::StringPrintf("Item %d", i)); | 19 AddItem(base::StringPrintf("Item %d", i)); |
| 16 } | 20 } |
| 17 | 21 |
| 18 void AppListTestModel::PopulateAppWithId(int id) { | 22 void AppListTestModel::PopulateAppWithId(int id) { |
| 19 AddItem(base::StringPrintf("Item %d", id)); | 23 AddItem(base::StringPrintf("Item %d", id)); |
| 20 } | 24 } |
| 21 | 25 |
| 22 std::string AppListTestModel::GetModelContent() { | 26 std::string AppListTestModel::GetModelContent() { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 39 apps()->Add(CreateItem(title)); | 43 apps()->Add(CreateItem(title)); |
| 40 } | 44 } |
| 41 | 45 |
| 42 void AppListTestModel::HighlightItemAt(int index) { | 46 void AppListTestModel::HighlightItemAt(int index) { |
| 43 AppListItemModel* item = apps()->GetItemAt(index); | 47 AppListItemModel* item = apps()->GetItemAt(index); |
| 44 item->SetHighlighted(true); | 48 item->SetHighlighted(true); |
| 45 } | 49 } |
| 46 | 50 |
| 47 } // namespace test | 51 } // namespace test |
| 48 } // namespace app_list | 52 } // namespace app_list |
| OLD | NEW |