OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/content/public/content_app_model_builder.h" | 5 #include "athena/content/public/content_app_model_builder.h" |
6 | 6 |
7 #include "apps/shell/browser/shell_extension_system.h" | 7 #include "apps/shell/browser/shell_extension_system.h" |
8 #include "athena/activity/public/activity_factory.h" | 8 #include "athena/activity/public/activity_factory.h" |
9 #include "athena/activity/public/activity_manager.h" | 9 #include "athena/activity/public/activity_manager.h" |
10 #include "extensions/browser/extension_icon_image.h" | 10 #include "extensions/browser/extension_icon_image.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 namespace { | 21 namespace { |
22 | 22 |
23 ShellExtensionSystem* GetShellExtensionSystem( | 23 ShellExtensionSystem* GetShellExtensionSystem( |
24 content::BrowserContext* context) { | 24 content::BrowserContext* context) { |
25 return static_cast<ShellExtensionSystem*>( | 25 return static_cast<ShellExtensionSystem*>( |
26 extensions::ExtensionSystem::Get(context)); | 26 extensions::ExtensionSystem::Get(context)); |
27 } | 27 } |
28 | 28 |
29 gfx::ImageSkia CreateFlatColorImage(SkColor color) { | 29 gfx::ImageSkia CreateFlatColorImage(SkColor color) { |
30 SkBitmap bitmap; | 30 SkBitmap bitmap; |
31 bitmap.setConfig( | 31 bitmap.allocN32Pixels(extension_misc::EXTENSION_ICON_MEDIUM, |
32 SkBitmap::kARGB_8888_Config, | 32 extension_misc::EXTENSION_ICON_MEDIUM); |
33 extension_misc::EXTENSION_ICON_MEDIUM, | |
34 extension_misc::EXTENSION_ICON_MEDIUM); | |
35 bitmap.allocPixels(); | |
36 bitmap.eraseColor(color); | 33 bitmap.eraseColor(color); |
37 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); | 34 return gfx::ImageSkia::CreateFrom1xBitmap(bitmap); |
38 } | 35 } |
39 | 36 |
40 // Same dummy item. | 37 // Same dummy item. |
41 class DummyItem : public app_list::AppListItem { | 38 class DummyItem : public app_list::AppListItem { |
42 public: | 39 public: |
43 DummyItem(const std::string& id, | 40 DummyItem(const std::string& id, |
44 const GURL& url, | 41 const GURL& url, |
45 SkColor color, | 42 SkColor color, |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 | 123 |
127 ShellExtensionSystem* extension_system = | 124 ShellExtensionSystem* extension_system = |
128 GetShellExtensionSystem(browser_context_); | 125 GetShellExtensionSystem(browser_context_); |
129 if (extension_system && extension_system->extension()) { | 126 if (extension_system && extension_system->extension()) { |
130 model->AddItem(scoped_ptr<app_list::AppListItem>( | 127 model->AddItem(scoped_ptr<app_list::AppListItem>( |
131 new AppItem(extension_system->extension(), browser_context_))); | 128 new AppItem(extension_system->extension(), browser_context_))); |
132 } | 129 } |
133 } | 130 } |
134 | 131 |
135 } // namespace athena | 132 } // namespace athena |
OLD | NEW |