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 "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
10 #include "third_party/skia/include/core/SkBitmap.h" | 10 #include "third_party/skia/include/core/SkBitmap.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 // static | 25 // static |
26 const char AppListTestModel::kItemType[] = "TestItem"; | 26 const char AppListTestModel::kItemType[] = "TestItem"; |
27 | 27 |
28 // AppListTestModel::AppListTestItem | 28 // AppListTestModel::AppListTestItem |
29 | 29 |
30 AppListTestModel::AppListTestItem::AppListTestItem( | 30 AppListTestModel::AppListTestItem::AppListTestItem( |
31 const std::string& id, | 31 const std::string& id, |
32 AppListTestModel* model) | 32 AppListTestModel* model) |
33 : AppListItem(id), | 33 : AppListItem(id), |
34 model_(model) { | 34 model_(model) { |
35 SetIcon(CreateImageSkia(kPreferredIconDimension, kPreferredIconDimension), | 35 SetIcon(CreateImageSkia(kGridIconDimension, kGridIconDimension), |
36 false /* has_shadow */); | 36 false /* has_shadow */); |
37 } | 37 } |
38 | 38 |
39 AppListTestModel::AppListTestItem::~AppListTestItem() { | 39 AppListTestModel::AppListTestItem::~AppListTestItem() { |
40 } | 40 } |
41 | 41 |
42 void AppListTestModel::AppListTestItem::Activate(int event_flags) { | 42 void AppListTestModel::AppListTestItem::Activate(int event_flags) { |
43 model_->ItemActivated(this); | 43 model_->ItemActivated(this); |
44 } | 44 } |
45 | 45 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 item->SetHighlighted(true); | 156 item->SetHighlighted(true); |
157 } | 157 } |
158 | 158 |
159 void AppListTestModel::ItemActivated(AppListTestItem* item) { | 159 void AppListTestModel::ItemActivated(AppListTestItem* item) { |
160 last_activated_ = item; | 160 last_activated_ = item; |
161 ++activate_count_; | 161 ++activate_count_; |
162 } | 162 } |
163 | 163 |
164 } // namespace test | 164 } // namespace test |
165 } // namespace app_list | 165 } // namespace app_list |
OLD | NEW |