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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 void Reload(scoped_refptr<const extensions::Extension> extension) { | 38 void Reload(scoped_refptr<const extensions::Extension> extension) { |
39 extension_ = extension; | 39 extension_ = extension; |
40 icon_image_.reset(new extensions::IconImage( | 40 icon_image_.reset(new extensions::IconImage( |
41 browser_context_, | 41 browser_context_, |
42 extension.get(), | 42 extension.get(), |
43 extensions::IconsInfo::GetIcons(extension.get()), | 43 extensions::IconsInfo::GetIcons(extension.get()), |
44 extension_misc::EXTENSION_ICON_MEDIUM, | 44 extension_misc::EXTENSION_ICON_MEDIUM, |
45 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 45 *ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
46 IDR_APP_DEFAULT_ICON), | 46 IDR_APP_DEFAULT_ICON), |
47 NULL)); | 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 virtual void Activate(int event_flags) override { |
56 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); | 56 ExtensionsDelegate::Get(browser_context_)->LaunchApp(extension_->id()); |
57 } | 57 } |
(...skipping 56 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 |