| 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" |
| 11 #include "ui/app_list/app_list_constants.h" | 11 #include "ui/app_list/app_list_constants.h" |
| 12 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
| 13 #include "ui/gfx/image/image_skia.h" | 13 #include "ui/gfx/image/image_skia.h" |
| 14 | 14 |
| 15 namespace app_list { | 15 namespace app_list { |
| 16 namespace test { | 16 namespace test { |
| 17 | 17 |
| 18 gfx::ImageSkia CreateImageSkia(int width, int height) { | 18 gfx::ImageSkia CreateImageSkia(int width, int height) { |
| 19 SkBitmap bitmap; | 19 SkBitmap bitmap; |
| 20 bitmap.setConfig(SkBitmap::kARGB_8888_Config, width, height); | 20 bitmap.allocN32Pixels(width, height); |
| 21 bitmap.allocPixels(); | |
| 22 bitmap.eraseARGB(255, 0, 255, 0); | 21 bitmap.eraseARGB(255, 0, 255, 0); |
| 23 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 22 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
| 24 } | 23 } |
| 25 | 24 |
| 26 // static | 25 // static |
| 27 const char AppListTestModel::kItemType[] = "TestItem"; | 26 const char AppListTestModel::kItemType[] = "TestItem"; |
| 28 | 27 |
| 29 // AppListTestModel::AppListTestItem | 28 // AppListTestModel::AppListTestItem |
| 30 | 29 |
| 31 AppListTestModel::AppListTestItem::AppListTestItem( | 30 AppListTestModel::AppListTestItem::AppListTestItem( |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 item->SetHighlighted(true); | 156 item->SetHighlighted(true); |
| 158 } | 157 } |
| 159 | 158 |
| 160 void AppListTestModel::ItemActivated(AppListTestItem* item) { | 159 void AppListTestModel::ItemActivated(AppListTestItem* item) { |
| 161 last_activated_ = item; | 160 last_activated_ = item; |
| 162 ++activate_count_; | 161 ++activate_count_; |
| 163 } | 162 } |
| 164 | 163 |
| 165 } // namespace test | 164 } // namespace test |
| 166 } // namespace app_list | 165 } // namespace app_list |
| OLD | NEW |