Index: chrome/browser/extensions/extension_action_manager.cc |
diff --git a/chrome/browser/extensions/extension_action_manager.cc b/chrome/browser/extensions/extension_action_manager.cc |
index 6d197c9046067590785fb780f6053df66dd2aa7f..30b5c7605f84c95024634cef18c0ac2a316c22b6 100644 |
--- a/chrome/browser/extensions/extension_action_manager.cc |
+++ b/chrome/browser/extensions/extension_action_manager.cc |
@@ -4,14 +4,17 @@ |
#include "chrome/browser/extensions/extension_action_manager.h" |
+#include "base/memory/ptr_util.h" |
#include "chrome/browser/extensions/api/system_indicator/system_indicator_manager_factory.h" |
#include "chrome/browser/extensions/extension_action.h" |
#include "chrome/browser/profiles/profile.h" |
#include "components/keyed_service/content/browser_context_dependency_manager.h" |
+#include "extensions/browser/extension_icon_image.h" |
#include "extensions/browser/extension_registry.h" |
#include "extensions/browser/extension_system.h" |
#include "extensions/browser/extensions_browser_client.h" |
#include "extensions/common/constants.h" |
+#include "ui/gfx/image/image_skia.h" |
namespace extensions { |
@@ -107,8 +110,16 @@ ExtensionAction* GetOrCreateOrNull( |
return nullptr; |
} |
- std::unique_ptr<ExtensionAction> action( |
- new ExtensionAction(extension, action_type, *action_info)); |
+ auto action = |
+ base::MakeUnique<ExtensionAction>(extension, action_type, *action_info); |
+ |
+ if (action->default_icon()) { |
+ action->SetDefaultIconImage(base::MakeUnique<IconImage>( |
+ profile, &extension, *action->default_icon(), |
+ ExtensionAction::ActionIconSize(), |
+ ExtensionAction::DefaultIcon().AsImageSkia(), nullptr)); |
asargent_no_longer_on_chrome
2016/11/18 00:55:27
The naming here is pretty confusing and I really h
Devlin
2016/11/18 01:56:47
Rename DefaultIcon() to FallbackIcon() - I agree t
asargent_no_longer_on_chrome
2016/11/18 18:29:33
Yeah, agreed. I guess to complete the thought, I w
|
+ } |
+ |
ExtensionAction* raw_action = action.get(); |
(*map)[extension.id()] = std::move(action); |
return raw_action; |