| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 45 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 46 IDR_APP_DEFAULT_ICON), | 46 IDR_APP_DEFAULT_ICON), |
| 47 nullptr)); | 47 nullptr)); |
| 48 icon_image_->image_skia().EnsureRepsForSupportedScales(); | 48 icon_image_->image_skia().EnsureRepsForSupportedScales(); |
| 49 SetIcon(icon_image_->image_skia(), false); | 49 SetIcon(icon_image_->image_skia(), false); |
| 50 SetName(extension->name()); | 50 SetName(extension->name()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 // Overridden from app_list::AppListItem: | 54 // Overridden from app_list::AppListItem: |
| 55 virtual void Activate(int event_flags) override { | 55 void Activate(int event_flags) override { |
| 56 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); | 56 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); |
| 57 } | 57 } |
| 58 | 58 |
| 59 scoped_refptr<const extensions::Extension> extension_; | 59 scoped_refptr<const extensions::Extension> extension_; |
| 60 content::BrowserContext* browser_context_; | 60 content::BrowserContext* browser_context_; |
| 61 scoped_ptr<extensions::IconImage> icon_image_; | 61 scoped_ptr<extensions::IconImage> icon_image_; |
| 62 | 62 |
| 63 DISALLOW_COPY_AND_ASSIGN(AppItem); | 63 DISALLOW_COPY_AND_ASSIGN(AppItem); |
| 64 }; | 64 }; |
| 65 | 65 |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 | 115 |
| 116 void ExtensionAppModelBuilder::OnExtensionUninstalled( | 116 void ExtensionAppModelBuilder::OnExtensionUninstalled( |
| 117 content::BrowserContext* browser_context, | 117 content::BrowserContext* browser_context, |
| 118 const extensions::Extension* extension, | 118 const extensions::Extension* extension, |
| 119 extensions::UninstallReason reason) { | 119 extensions::UninstallReason reason) { |
| 120 model_->DeleteItem(extension->id()); | 120 model_->DeleteItem(extension->id()); |
| 121 } | 121 } |
| 122 | 122 |
| 123 } // namespace athena | 123 } // namespace athena |
| OLD | NEW |