Commit f3f3ce76 authored by gpdavis.chromium's avatar gpdavis.chromium Committed by Commit bot

Update old syntax for action default_icon to populate 19 and 38px icons

BUG=404572

Review URL: https://codereview.chromium.org/508783002

Cr-Commit-Position: refs/heads/master@{#292236}
parent f15548e8
...@@ -105,7 +105,11 @@ scoped_ptr<ActionInfo> ActionInfo::Load(const Extension* extension, ...@@ -105,7 +105,11 @@ scoped_ptr<ActionInfo> ActionInfo::Load(const Extension* extension,
} else if (dict->GetString(keys::kPageActionDefaultIcon, &default_icon) && } else if (dict->GetString(keys::kPageActionDefaultIcon, &default_icon) &&
manifest_handler_helpers::NormalizeAndValidatePath( manifest_handler_helpers::NormalizeAndValidatePath(
&default_icon)) { &default_icon)) {
result->default_icon.Add(extension_misc::EXTENSION_ICON_ACTION, // Choose the most optimistic (highest) icon density - e.g. 38 not 19 -
// regardless of the actual icon resolution, whatever that happens to be.
// Code elsewhere knows how to scale 38 down to 19.
result->default_icon.Add(extension_misc::EXTENSION_ICON_ACTION *
extension_misc::kNumExtensionActionIconSizes,
default_icon); default_icon);
} else { } else {
*error = base::ASCIIToUTF16(errors::kInvalidPageActionIconPath); *error = base::ASCIIToUTF16(errors::kInvalidPageActionIconPath);
......
...@@ -60,7 +60,7 @@ TEST_F(BrowserActionManifestTest, ...@@ -60,7 +60,7 @@ TEST_F(BrowserActionManifestTest,
const ExtensionIconSet& icons = browser_action_info->default_icon; const ExtensionIconSet& icons = browser_action_info->default_icon;
EXPECT_EQ(1u, icons.map().size()); EXPECT_EQ(1u, icons.map().size());
EXPECT_EQ("icon.png", icons.Get(19, ExtensionIconSet::MATCH_EXACTLY)); EXPECT_EQ("icon.png", icons.Get(38, ExtensionIconSet::MATCH_EXACTLY));
} }
TEST_F(BrowserActionManifestTest, TEST_F(BrowserActionManifestTest,
......
...@@ -52,8 +52,8 @@ default icon is still supported: ...@@ -52,8 +52,8 @@ default icon is still supported:
... ...
<b>"browser_action": { <b>"browser_action": {
... ...
"default_icon": "images/icon19.png" <em>// optional</em> "default_icon": "images/icon38.png" <em>// optional</em>
<em>// equivalent to "default_icon": { "19": "images/icon19.png" }</em> <em>// equivalent to "default_icon": { "38": "images/icon38.png" }</em>
}</b>, }</b>,
... ...
} }
...@@ -162,7 +162,7 @@ $(ref:browserAction.setPopup) method. ...@@ -162,7 +162,7 @@ $(ref:browserAction.setPopup) method.
that make sense for only a few pages. that make sense for only a few pages.
Use <a href="pageAction">page actions</a> instead. Use <a href="pageAction">page actions</a> instead.
<li><b>Do</b> use big, colorful icons that make the most of <li><b>Do</b> use big, colorful icons that make the most of
the 19x19-pixel space. the 38x38-pixel space.
Browser action icons should seem a little bigger Browser action icons should seem a little bigger
and heavier than page action icons. and heavier than page action icons.
<li><b>Don't</b> attempt to mimic <li><b>Don't</b> attempt to mimic
......
...@@ -57,8 +57,8 @@ default icon is still supported: ...@@ -57,8 +57,8 @@ default icon is still supported:
... ...
<b>"page_action": { <b>"page_action": {
... ...
"default_icon": "images/icon19.png" <em>// optional</em> "default_icon": "images/icon38.png" <em>// optional</em>
<em>// equivalent to "default_icon": { "19": "images/icon19.png" }</em> <em>// equivalent to "default_icon": { "38": "images/icon38.png" }</em>
}</b>, }</b>,
... ...
}</pre> }</pre>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment