| 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 | 8 |
| 9 namespace app_list { | 9 namespace app_list { |
| 10 namespace test { | 10 namespace test { |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 position = syncer::StringOrdinal::CreateInitialOrdinal(); | 77 position = syncer::StringOrdinal::CreateInitialOrdinal(); |
| 78 else | 78 else |
| 79 position = item_list()->item_at(nitems - 1)->position().CreateAfter(); | 79 position = item_list()->item_at(nitems - 1)->position().CreateAfter(); |
| 80 item->SetPosition(position); | 80 item->SetPosition(position); |
| 81 item->SetTitleAndFullName(title, full_name); | 81 item->SetTitleAndFullName(title, full_name); |
| 82 return item; | 82 return item; |
| 83 } | 83 } |
| 84 | 84 |
| 85 void AppListTestModel::CreateAndAddItem(const std::string& title, | 85 void AppListTestModel::CreateAndAddItem(const std::string& title, |
| 86 const std::string& full_name) { | 86 const std::string& full_name) { |
| 87 item_list()->AddItem(CreateItem(title, full_name)); | 87 AddItem(CreateItem(title, full_name)); |
| 88 } | 88 } |
| 89 | 89 |
| 90 void AppListTestModel::CreateAndAddItem(const std::string& title) { | 90 void AppListTestModel::CreateAndAddItem(const std::string& title) { |
| 91 CreateAndAddItem(title, title); | 91 CreateAndAddItem(title, title); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void AppListTestModel::HighlightItemAt(int index) { | 94 void AppListTestModel::HighlightItemAt(int index) { |
| 95 AppListItem* item = item_list()->item_at(index); | 95 AppListItem* item = item_list()->item_at(index); |
| 96 item->SetHighlighted(true); | 96 item->SetHighlighted(true); |
| 97 } | 97 } |
| 98 | 98 |
| 99 void AppListTestModel::ItemActivated(AppListTestItemModel* item) { | 99 void AppListTestModel::ItemActivated(AppListTestItemModel* item) { |
| 100 last_activated_ = item; | 100 last_activated_ = item; |
| 101 ++activate_count_; | 101 ++activate_count_; |
| 102 } | 102 } |
| 103 | 103 |
| 104 } // namespace test | 104 } // namespace test |
| 105 } // namespace app_list | 105 } // namespace app_list |
| OLD | NEW |