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 12 matching lines...) Expand all Loading... |
23 // static | 23 // static |
24 const char AppListTestModel::kItemType[] = "TestItem"; | 24 const char AppListTestModel::kItemType[] = "TestItem"; |
25 | 25 |
26 // AppListTestModel::AppListTestItem | 26 // AppListTestModel::AppListTestItem |
27 | 27 |
28 AppListTestModel::AppListTestItem::AppListTestItem( | 28 AppListTestModel::AppListTestItem::AppListTestItem( |
29 const std::string& id, | 29 const std::string& id, |
30 AppListTestModel* model) | 30 AppListTestModel* model) |
31 : AppListItem(id), | 31 : AppListItem(id), |
32 model_(model) { | 32 model_(model) { |
33 SetIcon(CreateImageSkia(kGridIconDimension, kGridIconDimension), | 33 SetIcon(CreateImageSkia(kGridIconDimension, kGridIconDimension)); |
34 false /* has_shadow */); | |
35 } | 34 } |
36 | 35 |
37 AppListTestModel::AppListTestItem::~AppListTestItem() { | 36 AppListTestModel::AppListTestItem::~AppListTestItem() { |
38 } | 37 } |
39 | 38 |
40 void AppListTestModel::AppListTestItem::Activate(int event_flags) { | 39 void AppListTestModel::AppListTestItem::Activate(int event_flags) { |
41 model_->ItemActivated(this); | 40 model_->ItemActivated(this); |
42 } | 41 } |
43 | 42 |
44 const char* AppListTestModel::AppListTestItem::GetItemType() const { | 43 const char* AppListTestModel::AppListTestItem::GetItemType() const { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 top_level_item_list()->HighlightItemInstalledFromUI(item->id()); | 153 top_level_item_list()->HighlightItemInstalledFromUI(item->id()); |
155 } | 154 } |
156 | 155 |
157 void AppListTestModel::ItemActivated(AppListTestItem* item) { | 156 void AppListTestModel::ItemActivated(AppListTestItem* item) { |
158 last_activated_ = item; | 157 last_activated_ = item; |
159 ++activate_count_; | 158 ++activate_count_; |
160 } | 159 } |
161 | 160 |
162 } // namespace test | 161 } // namespace test |
163 } // namespace app_list | 162 } // namespace app_list |
OLD | NEW |