Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1223)

Unified Diff: chrome/common/extensions/docs/server2/templates/intros/browserAction.html

Issue 10905005: Change browser/page action default icon defined in manifest to support hidpi. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: forgot to update tests Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/templates/intros/browserAction.html
diff --git a/chrome/common/extensions/docs/server2/templates/intros/browserAction.html b/chrome/common/extensions/docs/server2/templates/intros/browserAction.html
index d4c7476825997882d33b00b2a8d6d040554c960f..84599e42fefac31faffb2efa0e910f23810539b4 100644
--- a/chrome/common/extensions/docs/server2/templates/intros/browserAction.html
+++ b/chrome/common/extensions/docs/server2/templates/intros/browserAction.html
@@ -44,13 +44,33 @@ like this:
"name": "My extension",
...
<b>"browser_action": {
- "default_icon": "images/icon19.png", <em>// optional</em>
+ "default_icon": { <em>// optional</em>
+ "19": "images/icon19.png", <em>// optional</em>
+ "38": "images/icon38.png" <em>// optional</em>
+ },
"default_title": "Google Mail", <em>// optional; shown in tooltip</em>
"default_popup": "popup.html" <em>// optional</em>
}</b>,
...
}</pre>
+<p>
+If you don't care about icon appearance when screens's device-independent
Jeffrey Yasskin 2012/09/17 20:18:39 "don't care" is a little strong. The tech writers
mkearney1 2012/09/17 21:17:45 I like Jeffrey's suggestion. But I think I would s
tbarzic 2012/09/17 22:06:10 Done.
+pixel (dip) size is different from its physical pixel size, you can register
+the default icon like this:
+</p>
+
+<pre>{
+ "name": "My extension",
+ ...
+ <b>"browser_action": {
+ ...
+ "default_icon": "images/icon19.png" <em>// optional</em>
+ <em>// equal to "default_icon": { "19": "images/icon19.png" }</em>
Jeffrey Yasskin 2012/09/17 20:18:39 s/equal/equivalent/
tbarzic 2012/09/17 22:06:10 Done.
+ }</b>,
+ ...
+}</pre>
+
<h2 id="ui">Parts of the UI</h2>
<p>
@@ -62,9 +82,9 @@ and a <a href="#popups">popup</a>.
<h3 id="icon">Icon</h3>
-<p>Browser action icons can be up to 19 pixels wide and high.
+<p>Browser action icons can be up to 19 dips wide and high.
Jeffrey Yasskin 2012/09/17 20:18:39 Explain the acronym the first time you use it in a
tbarzic 2012/09/17 22:06:10 Done.
tbarzic 2012/09/17 22:06:10 Done.
Larger icons are resized to fit, but for best results,
- use a 19-pixel square icon.</p>
+ use a 19-dip size square icon.</p>
Jeffrey Yasskin 2012/09/17 20:18:39 No need for "size" since it wasn't there when "pix
tbarzic 2012/09/17 22:06:10 Done.
<p>You can set the icon in two ways:
using a static image or using the
@@ -80,10 +100,18 @@ and a <a href="#popups">popup</a>.
</p>
<p>To set the icon,
-use the <b>default_icon</b> field of <b>browser_action</b>
-in the <a href="#manifest">manifest</a>,
-or call the <a href="#method-setIcon">setIcon()</a> method.
+ use the <b>default_icon</b> field of <b>browser_action</b>
+ in the <a href="#manifest">manifest</a>,
+ or call the <a href="#method-setIcon">setIcon()</a> method.
+ </p>
+<p>To properly display icon when screen pixel density (ratio
+ <code>size_in_dip / size_in_pixel</code>) is different than 1,
Jeffrey Yasskin 2012/09/17 20:18:39 This should be "<code>size_in_pixels / size_in_dip
tbarzic 2012/09/17 22:06:10 Done.
+ the icon can be defined as set of images with different sizes.
+ The actual image to display will be selected from the set to
+ best fit the pixel size of 19 dip icon.
+ At the moment, the icon set can contain images with pixel sizes 19 and 38.
+ </p>
<h3 id="tooltip">Tooltip</h3>
@@ -169,4 +197,4 @@ You can find simple examples of using browser actions in the
directory.
For other examples and for help in viewing the source code, see
<a href="samples.html">Samples</a>.
-</p>
+</p>

Powered by Google App Engine
This is Rietveld 408576698