| 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/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "third_party/skia/include/core/SkBitmap.h" | 9 #include "third_party/skia/include/core/SkBitmap.h" |
| 10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 top_level_item_list()->item_at(nitems - 1)->position().CreateAfter(); | 139 top_level_item_list()->item_at(nitems - 1)->position().CreateAfter(); |
| 140 } | 140 } |
| 141 item->SetPosition(position); | 141 item->SetPosition(position); |
| 142 SetItemName(item, id); | 142 SetItemName(item, id); |
| 143 return item; | 143 return item; |
| 144 } | 144 } |
| 145 | 145 |
| 146 AppListTestModel::AppListTestItem* AppListTestModel::CreateAndAddItem( | 146 AppListTestModel::AppListTestItem* AppListTestModel::CreateAndAddItem( |
| 147 const std::string& id) { | 147 const std::string& id) { |
| 148 scoped_ptr<AppListTestItem> test_item(CreateItem(id)); | 148 scoped_ptr<AppListTestItem> test_item(CreateItem(id)); |
| 149 AppListItem* item = AppListModel::AddItem(test_item.PassAs<AppListItem>()); | 149 AppListItem* item = AppListModel::AddItem(test_item.Pass()); |
| 150 return static_cast<AppListTestItem*>(item); | 150 return static_cast<AppListTestItem*>(item); |
| 151 } | 151 } |
| 152 void AppListTestModel::HighlightItemAt(int index) { | 152 void AppListTestModel::HighlightItemAt(int index) { |
| 153 AppListItem* item = top_level_item_list()->item_at(index); | 153 AppListItem* item = top_level_item_list()->item_at(index); |
| 154 top_level_item_list()->HighlightItemInstalledFromUI(item->id()); | 154 top_level_item_list()->HighlightItemInstalledFromUI(item->id()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 void AppListTestModel::ItemActivated(AppListTestItem* item) { | 157 void AppListTestModel::ItemActivated(AppListTestItem* item) { |
| 158 last_activated_ = item; | 158 last_activated_ = item; |
| 159 ++activate_count_; | 159 ++activate_count_; |
| 160 } | 160 } |
| 161 | 161 |
| 162 } // namespace test | 162 } // namespace test |
| 163 } // namespace app_list | 163 } // namespace app_list |
| OLD | NEW |