| 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/extensions/public/extension_app_model_builder.h" | 5 #include "athena/extensions/public/extension_app_model_builder.h" |
| 6 | 6 |
| 7 #include "athena/activity/public/activity_factory.h" | 7 #include "athena/activity/public/activity_factory.h" |
| 8 #include "athena/activity/public/activity_manager.h" | 8 #include "athena/activity/public/activity_manager.h" |
| 9 #include "athena/extensions/public/extensions_delegate.h" | 9 #include "athena/extensions/public/extensions_delegate.h" |
| 10 #include "extensions/browser/extension_icon_image.h" | 10 #include "extensions/browser/extension_icon_image.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 34 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 35 IDR_APP_DEFAULT_ICON), | 35 IDR_APP_DEFAULT_ICON), |
| 36 NULL) { | 36 NULL) { |
| 37 icon_image_.image_skia().EnsureRepsForSupportedScales(); | 37 icon_image_.image_skia().EnsureRepsForSupportedScales(); |
| 38 SetIcon(icon_image_.image_skia(), false); | 38 SetIcon(icon_image_.image_skia(), false); |
| 39 SetName(extension->name()); | 39 SetName(extension->name()); |
| 40 } | 40 } |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // Overridden from app_list::AppListItem: | 43 // Overridden from app_list::AppListItem: |
| 44 virtual void Activate(int event_flags) OVERRIDE { | 44 virtual void Activate(int event_flags) override { |
| 45 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); | 45 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); |
| 46 } | 46 } |
| 47 | 47 |
| 48 scoped_refptr<const extensions::Extension> extension_; | 48 scoped_refptr<const extensions::Extension> extension_; |
| 49 content::BrowserContext* browser_context_; | 49 content::BrowserContext* browser_context_; |
| 50 extensions::IconImage icon_image_; | 50 extensions::IconImage icon_image_; |
| 51 | 51 |
| 52 DISALLOW_COPY_AND_ASSIGN(AppItem); | 52 DISALLOW_COPY_AND_ASSIGN(AppItem); |
| 53 }; | 53 }; |
| 54 | 54 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 70 ++iter) { | 70 ++iter) { |
| 71 // TODO(mukai): use chrome/browser/extension_ui_util. | 71 // TODO(mukai): use chrome/browser/extension_ui_util. |
| 72 if ((*iter)->ShouldDisplayInAppLauncher()) { | 72 if ((*iter)->ShouldDisplayInAppLauncher()) { |
| 73 model->AddItem(scoped_ptr<app_list::AppListItem>( | 73 model->AddItem(scoped_ptr<app_list::AppListItem>( |
| 74 new AppItem(*iter, browser_context_))); | 74 new AppItem(*iter, browser_context_))); |
| 75 } | 75 } |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 } // namespace athena | 79 } // namespace athena |
| OLD | NEW |