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

Side by Side Diff: chrome/common/extensions/docs/templates/intros/pageAction.html

Issue 2452683002: [Extensions Docs] Update browser/page action documentation (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/browserAction.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <p> 1 <p>
2 Some examples: 2 Some examples:
3 </p> 3 </p>
4 <ul> 4 <ul>
5 <li> Subscribe to this page's RSS feed </li> 5 <li> Subscribe to this page's RSS feed </li>
6 <li> Make a slideshow out of this page's photos </li> 6 <li> Make a slideshow out of this page's photos </li>
7 </ul> 7 </ul>
8 8
9 <p> 9 <p>
10 The RSS icon in the following screenshot 10 The RSS icon in the following screenshot
(...skipping 27 matching lines...) Expand all
38 <a href="manifest">extension manifest</a> 38 <a href="manifest">extension manifest</a>
39 like this: 39 like this:
40 </p> 40 </p>
41 41
42 <pre data-filename="manifest.json"> 42 <pre data-filename="manifest.json">
43 { 43 {
44 "name": "My extension", 44 "name": "My extension",
45 ... 45 ...
46 <b>"page_action": { 46 <b>"page_action": {
47 "default_icon": { <em>// optional</em> 47 "default_icon": { <em>// optional</em>
48 "19": "images/icon19.png", <em>// optional</em> 48 "16": "images/icon16.png", <em>// optional</em>
49 "38": "images/icon38.png" <em>// optional</em> 49 "24": "images/icon24.png", <em>// optional</em>
50 "32": "images/icon32.png" <em>// optional</em>
50 }, 51 },
51 "default_title": "Google Mail", <em>// optional; shown in tooltip</em> 52 "default_title": "Google Mail", <em>// optional; shown in tooltip</em>
52 "default_popup": "popup.html" <em>// optional</em> 53 "default_popup": "popup.html" <em>// optional</em>
53 }</b>, 54 }</b>,
54 ... 55 ...
55 }</pre> 56 }</pre>
56 57
57 <p> 58 <p>
58 If you only provide one of the 19px or 38px icon size, the extension system will 59 You can provide any size icon to be used in Chrome, and Chrome will select the
59 scale the icon you provide to the pixel density of the user's display, which 60 closest one and scale it to the appropriate size to fill the 16-dip space.
60 can lose detail or make it look fuzzy. The old syntax for registering the 61 However, if the exact size isn't provided, this scaling can cause the icon to
61 default icon is still supported: 62 lose detail or look fuzzy.
63 </p>
64
65 <p>
66 Since devices with less-common scale factors like 1.5x or 1.2x are becoming more
67 common, you are encouraged to provide multiple sizes for your icons. This also
68 ensures that if the icon display size is ever changed, you don't need to do any
69 more work to provide different icons!
70 </p>
71
72 <p>
73 The old syntax for registering the default icon is still supported:
62 </p> 74 </p>
63 75
64 <pre data-filename="manifest.json"> 76 <pre data-filename="manifest.json">
65 { 77 {
66 "name": "My extension", 78 "name": "My extension",
67 ... 79 ...
68 <b>"page_action": { 80 <b>"page_action": {
69 ... 81 ...
70 "default_icon": "images/icon38.png" <em>// optional</em> 82 "default_icon": "images/icon32.png" <em>// optional</em>
71 <em>// equivalent to "default_icon": { "38": "images/icon38.png" }</em> 83 <em>// equivalent to "default_icon": { "32": "images/icon32.png" }</em>
72 }</b>, 84 }</b>,
73 ... 85 ...
74 }</pre> 86 }
87 </pre>
75 88
76 <h2 id="ui">Parts of the UI</h2> 89 <h2 id="ui">Parts of the UI</h2>
77 90
78 <p> 91 <p>
79 Like browser actions, 92 Like browser actions,
80 page actions can have an icon, 93 page actions can have an icon,
81 a tooltip, and popup; 94 a tooltip, and popup;
82 they can't have badges, however. 95 they can't have badges, however.
83 In addition, page actions can be grayed out. 96 In addition, page actions can be grayed out.
84 You can find information about icons, tooltips, and popups 97 You can find information about icons, tooltips, and popups
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 132
120 <h2 id="examples"> Examples </h2> 133 <h2 id="examples"> Examples </h2>
121 134
122 <p> 135 <p>
123 You can find simple examples of using page actions in the 136 You can find simple examples of using page actions in the
124 <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/e xtensions/docs/examples/api/pageAction/">examples/api/pageAction</a> 137 <a href="https://chromium.googlesource.com/chromium/src/+/master/chrome/common/e xtensions/docs/examples/api/pageAction/">examples/api/pageAction</a>
125 directory. 138 directory.
126 For other examples and for help in viewing the source code, see 139 For other examples and for help in viewing the source code, see
127 <a href="samples">Samples</a>. 140 <a href="samples">Samples</a>.
128 </p> 141 </p>
OLDNEW
« no previous file with comments | « chrome/common/extensions/docs/templates/intros/browserAction.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698