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

Side by Side Diff: chrome/browser/resources/plugins.html

Issue 1991005: (1) Group plugins with the same name together. (2) Show a download link for p... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 10 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/plugin_updater_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html i18n-values="dir:textdirection;"> 2 <html i18n-values="dir:textdirection;">
3 <head> 3 <head>
4 <meta charset="utf-8"> 4 <meta charset="utf-8">
5 <title i18n-content="pluginsTitle"></title> 5 <title i18n-content="pluginsTitle"></title>
6 <style> 6 <style>
7 7
8 body { 8 body {
9 margin: 10px; 9 margin: 10px;
10 min-width: 47em; 10 min-width: 47em;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 padding-top: 0.8em; 155 padding-top: 0.8em;
156 width: 100%; 156 width: 100%;
157 } 157 }
158 158
159 html[dir=rtl] .tmi-mode { 159 html[dir=rtl] .tmi-mode {
160 padding-right: 10px; 160 padding-right: 10px;
161 padding-left: 0; 161 padding-left: 0;
162 } 162 }
163 163
164 .plugin-disabled > td { 164 .plugin-disabled > td {
165 background: url('gray.png') 0px 0px; 165 background-color: #f0f0f0;
166 color: #a0a0a0; 166 color: #a0a0a0;
167 padding-bottom: 4px; 167 padding-bottom: 4px;
168 padding-top: 5px; 168 padding-top: 5px;
169 } 169 }
170 170
171 .plugin-enabled > td { 171 .plugin-enabled > td {
172 padding-bottom: 4px; 172 padding-bottom: 4px;
173 padding-top: 5px; 173 padding-top: 5px;
174 } 174 }
175 175
176 .plugin-file-disabled {
177 background-color: #f0f0f0;
178 color: #a0a0a0;
179 padding-top: 5px;
180 padding-bottom: 5px;
181 }
182
183 .plugin-file-enabled {
184 padding-top: 5px;
185 padding-bottom: 5px;
186 }
187
176 .plugin { 188 .plugin {
177 border-bottom: 1px solid #cdcdcd; 189 border-bottom: 1px solid #cdcdcd;
178 } 190 }
179 191
192 .critical {
193 color: red;
194 }
195
180 /* Indent the text related to each plug-in. */ 196 /* Indent the text related to each plug-in. */
181 .plugin-text { 197 .plugin-text {
182 padding-left: 5px; 198 padding-left: 5px;
183 } 199 }
184 200
185 html[dir=rtl] .plugin-text { 201 html[dir=rtl] .plugin-text {
186 padding-right: 5px; 202 padding-right: 5px;
187 padding-left: 0; 203 padding-left: 0;
188 } 204 }
189 205
190 .plugin-name { 206 .plugin-name {
191 font-weight: bold; 207 font-weight: bold;
192 } 208 }
193 209
194 .no-plugins { 210 .no-plugins {
195 margin: 6em 0 0; 211 margin: 6em 0 0;
196 text-align: center; 212 text-align: center;
197 font-size: 1.2em; 213 font-size: 1.2em;
198 } 214 }
199 215
200 /* Use tables for layout, so eliminate extra spacing. */ 216 /* Use tables for layout, so eliminate extra spacing. */
201 .plugin-details table { 217 .plugin-details table {
202 -webkit-border-horizontal-spacing: 0; 218 -webkit-border-horizontal-spacing: 0;
203 -webkit-border-vertical-spacing: 0; 219 -webkit-border-vertical-spacing: 0;
204 } 220 }
205 221
222 .plugin-details {
223 padding-left: 1em;
224 }
225
206 /* Separate the inital line, Description, Location, and MIME Types lines. */ 226 /* Separate the inital line, Description, Location, and MIME Types lines. */
207 .plugin-details > div { 227 .plugin-details > div {
208 padding-top: 0.1em 228 padding-top: 0.1em
209 } 229 }
210 230
211 /* Align rows of tables along the top. */ 231 /* Align rows of tables along the top. */
212 .plugin-details tr { 232 .plugin-details tr {
213 vertical-align: top; 233 vertical-align: top;
214 } 234 }
215 235
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
262 282
263 </style> 283 </style>
264 <script> 284 <script>
265 285
266 /** 286 /**
267 * This variable structure is here to document the structure that the template 287 * This variable structure is here to document the structure that the template
268 * expects to correctly populate the page. 288 * expects to correctly populate the page.
269 */ 289 */
270 var pluginDataFormat = { 290 var pluginDataFormat = {
271 'plugins': [ 291 'plugins': [
272 { 292 { 'name': 'Group Name',
273 'path': '/blahblah/blahblah/MyCrappyPlugin.plugin', 293 'description': 'description',
274 'name': 'MyCrappyPlugin', 294 'version': 'version',
275 'version': '1.2.3', 295 'update_url': 'http://update/',
276 'description': 'My crappy plugin', 296 'critical': true,
277 'mimeTypes': [ 297 'enabled': true,
278 { 'description': 'Foo Media', 298 'plugin_files': [
279 'fileExtensions': [ 'foo' ], 299 {
280 'mimeType': 'application/x-my-foo' }, 300 'path': '/blahblah/blahblah/MyCrappyPlugin.plugin',
281 { 'description': 'Bar Stuff', 301 'name': 'MyCrappyPlugin',
282 'fileExtensions': [ 'bar','baz' ], 302 'version': '1.2.3',
283 'mimeType': 'application/my-bar' } 303 'description': 'My crappy plugin',
284 ], 304 'mimeTypes': [
285 'enabled': true 305 { 'description': 'Foo Media',
286 }, 306 'fileExtensions': [ 'foo' ],
287 { 307 'mimeType': 'application/x-my-foo' },
288 'path': '/foobar/baz/YourGreatPlugin.plugin', 308 { 'description': 'Bar Stuff',
289 'name': 'YourGreatPlugin', 309 'fileExtensions': [ 'bar','baz' ],
290 'version': '4.5', 310 'mimeType': 'application/my-bar' }
291 'description': 'Your great plugin', 311 ],
292 'mimeTypes': [ 312 'enabled': true
293 { 'description': 'Baz Stuff', 313 },
294 'fileExtensions': [ 'baz' ], 314 {
295 'mimeType': 'application/x-your-baz' } 315 'path': '/foobar/baz/YourGreatPlugin.plugin',
296 ], 316 'name': 'YourGreatPlugin',
297 'enabled': false 317 'version': '4.5',
318 'description': 'Your great plugin',
319 'mimeTypes': [
320 { 'description': 'Baz Stuff',
321 'fileExtensions': [ 'baz' ],
322 'mimeType': 'application/x-your-baz' }
323 ],
324 'enabled': false
325 }
326 ]
298 } 327 }
299 ] 328 ]
300 }; 329 };
301 330
302 /** 331 /**
303 * Takes the |pluginsData| input argument which represents data about the 332 * Takes the |pluginsData| input argument which represents data about the
304 * currently installed/running plugins and populates the html jstemplate with 333 * currently installed/running plugins and populates the html jstemplate with
305 * that data. It expects an object structure like the above. 334 * that data. It expects an object structure like the above.
306 * @param {Object} pluginsData Detailed info about installed plugins 335 * @param {Object} pluginsData Detailed info about installed plugins
307 */ 336 */
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 document.getElementById('expand').style.display = 397 document.getElementById('expand').style.display =
369 tmiModeExpanded ? 'none' : 'inline'; 398 tmiModeExpanded ? 'none' : 'inline';
370 bodyContainer.style.visibility = 'visible'; 399 bodyContainer.style.visibility = 'visible';
371 body.className = tmiModeExpanded ? 400 body.className = tmiModeExpanded ?
372 'showTmiModeInitial' : 'hideTmiModeInitial'; 401 'showTmiModeInitial' : 'hideTmiModeInitial';
373 } 402 }
374 403
375 /** 404 /**
376 * Handles a 'enable' or 'disable' button getting clicked. 405 * Handles a 'enable' or 'disable' button getting clicked.
377 */ 406 */
378 function handleEnablePlugin(node, enable) { 407 function handleEnablePlugin(node, enable, is_group) {
379 // Tell the C++ PluginsDOMHandler to enable/disable the plugin. 408 // Tell the C++ PluginsDOMHandler to enable/disable the plugin.
380 chrome.send('enablePlugin', [node.pluginPath, String(enable)]); 409 chrome.send('enablePlugin', [String(node.path), String(enable),
410 String(is_group)]);
381 requestPluginsData(); 411 requestPluginsData();
382 } 412 }
383 413
384 // Keeps track of whether details have been made visible (expanded) or not. 414 // Keeps track of whether details have been made visible (expanded) or not.
385 var tmiModeExpanded = false; 415 var tmiModeExpanded = false;
386 416
387 /* 417 /*
388 * Toggles visibility of details. 418 * Toggles visibility of details.
389 */ 419 */
390 function toggleTmiMode() { 420 function toggleTmiMode() {
391 tmiModeExpanded = !tmiModeExpanded; 421 tmiModeExpanded = !tmiModeExpanded;
392 422
393 document.getElementById('collapse').style.display = 423 document.getElementById('collapse').style.display =
394 tmiModeExpanded ? 'inline' : 'none'; 424 tmiModeExpanded ? 'inline' : 'none';
395 document.getElementById('expand').style.display = 425 document.getElementById('expand').style.display =
396 tmiModeExpanded ? 'none' : 'inline'; 426 tmiModeExpanded ? 'none' : 'inline';
397 427
398 document.body.className = 428 document.body.className =
399 tmiModeExpanded ? 'showTmiMode' : 'hideTmiMode'; 429 tmiModeExpanded ? 'showTmiMode' : 'hideTmiMode';
400 } 430 }
401 431
402 /** 432 /**
403 * Determines whether a plugin's version should be displayed. 433 * Determines whether a plugin's version should be displayed.
404 */ 434 */
405 function shouldDisplayPluginVersion(plugin) { 435 function shouldDisplayPluginVersion(plugin) {
406 return !!plugin.version; 436 return !!plugin.version && plugin.version != "0";
407 } 437 }
408 438
409 /** 439 /**
410 * Determines whether a plugin's description should be displayed. 440 * Determines whether a plugin's description should be displayed.
411 */ 441 */
412 function shouldDisplayPluginDescription(plugin) { 442 function shouldDisplayPluginDescription(plugin) {
413 // Only display the description if it's not blank and if it's not just the 443 // Only display the description if it's not blank and if it's not just the
414 // name, version, or combination thereof. 444 // name, version, or combination thereof.
415 return plugin.description && 445 return plugin.description &&
416 plugin.description != plugin.name && 446 plugin.description != plugin.name &&
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
473 503
474 <div jsdisplay="plugins.length > 0"> 504 <div jsdisplay="plugins.length > 0">
475 <div class="plugin" jsselect="plugins"> 505 <div class="plugin" jsselect="plugins">
476 <table width="100%" cellpadding="2" cellspacing="0"> 506 <table width="100%" cellpadding="2" cellspacing="0">
477 <tr jsvalues= 507 <tr jsvalues=
478 ".className:enabled ? 'plugin-enabled' : 'plugin-disabled'"> 508 ".className:enabled ? 'plugin-enabled' : 'plugin-disabled'">
479 <td valign="top"> 509 <td valign="top">
480 <div class="plugin-text"> 510 <div class="plugin-text">
481 <div> 511 <div>
482 <span class="plugin-name" dir="ltr" 512 <span class="plugin-name" dir="ltr"
483 jscontent="name">PLUGIN NAME</span> 513 jscontent="name">NAME</span>
514 <span jsdisplay="plugin_files.length > 1"
515 jscontent="'(' + plugin_files.length +' files)'">(x)</span>
484 <span jsdisplay="shouldDisplayPluginVersion($this)"> 516 <span jsdisplay="shouldDisplayPluginVersion($this)">
485 - <span i18n-content="pluginVersion">VERSION</span> 517 - <span i18n-content="pluginVersion">VERSION</span>
486 <span dir="ltr" jscontent="version">x.x.x.x</span> 518 <span jsvalues=".className:critical? 'critical': ''"
519 dir="ltr" jscontent="version">x.x.x.x</span>
487 </span> 520 </span>
521 <a jsdisplay="critical" jsvalues=".href:update_url"
522 i18n-content="pluginDownload">DOWNLOAD UPDATE</a>
488 <span jsdisplay="!enabled" 523 <span jsdisplay="!enabled"
489 i18n-content="pluginDisabled">(DISABLED)</span> 524 i18n-content="pluginDisabled">(DISABLED)</span>
525 <div jsdisplay="shouldDisplayPluginDescription($this)">
526 <span dir="ltr" jsvalues=".innerHTML:description">
527 </div>
490 </div> 528 </div>
491 <div class="plugin-details"> 529 <div jsselect="plugin_files" class="plugin-details">
492 <div><table><tr jsdisplay="shouldDisplayPluginDescription($this)">
493 <td class="plugin-details-label"
494 i18n-content="pluginDescription">DESCRIPTION:</td>
495 <td><span dir="ltr" jsvalues=".innerHTML:description"></td>
496 </tr></table></div>
497 <div><table><tr>
498 <td class="plugin-details-label"
499 i18n-content="pluginPath">PATH:</td>
500 <td><span dir="ltr" jscontent="path"></span></td>
501 </tr></table></div>
502 <div class="showInTmiMode"> 530 <div class="showInTmiMode">
503 <table><tr jsdisplay="mimeTypes.length > 0"> 531 <div jsvalues=
504 <td class="plugin-details-label" 532 ".className:enabled ? 'plugin-file-enabled' : 'plugin-file-dis abled'">
505 i18n-content="pluginMimeTypes">MIME_TYPES:</td> 533 <div><table><tr>
506 <td><table width="100%" class="mime-types"> 534 <td class="plugin-details-label"
507 <tr class="header"> 535 i18n-content="pluginName">NAME:</td>
508 <td i18n-content="pluginMimeTypesMimeType" 536 <td><span dir="ltr" jscontent="name">NAME</span></td>
509 >MIME type</td> 537 </tr></table></div>
510 <td i18n-content="pluginMimeTypesDescription" 538 <div><table><tr jsdisplay="shouldDisplayPluginDescription($thi s)">
511 >DESCRIPTION</td> 539 <td class="plugin-details-label"
512 <td i18n-content="pluginMimeTypesFileExtensions" 540 i18n-content="pluginDescription">DESCRIPTION:</td>
513 >FILE_EXTENSIONS</td> 541 <td><span dir="ltr" jsvalues=".innerHTML:description"></td>
514 </tr> 542 </tr></table></div>
515 <tr jsselect="mimeTypes"> 543 <div><table><tr>
516 <td><span dir="ltr" 544 <td class="plugin-details-label"
517 jscontent="mimeType"></span></td> 545 i18n-content="pluginVersion">VERSION:</td>
518 <td><span dir="ltr" 546 <td><span dir="ltr" jscontent="version">x.x.x.x</span></td>
519 jsvalues=".innerHTML:description"></span></td> 547 </tr></table></div>
520 <td><table jsdisplay="fileExtensions.length > 0" 548 <div><table><tr>
521 class="hlisting"> 549 <td class="plugin-details-label"
522 <tr><td jsselect="fileExtensions"> 550 i18n-content="pluginPriority">PRIORITY:</td>
523 <span dir="ltr" jscontent="'.' + $this"> 551 <td><span dir="ltr" jscontent="priority">x</span></td>
524 </td></tr> 552 </tr></table></div>
525 </table></td> 553 <div><table><tr>
526 </tr> 554 <td class="plugin-details-label"
527 </table></td> 555 i18n-content="pluginPath">PATH:</td>
528 </tr></table> 556 <td><span dir="ltr" jscontent="path"></span></td>
557 </tr></table></div>
558 <div><table><tr>
559 <td class="plugin-details-label">&nbsp;</td>
560 <td>
561 <span jsdisplay="!enabled"
562 i18n-content="pluginDisabled">(DISABLED)</span>
563 <span>
564 <a
565 jsvalues=".path:path"
566 jsdisplay="enabled"
567 onclick="handleEnablePlugin(this, false, false)"
568 href="javascript:void(0);"
569 i18n-content="disable"
570 >DISABLE</a>
571 <a
572 jsvalues=".path:path"
573 jsdisplay="!enabled"
574 onclick="handleEnablePlugin(this, true, false)"
575 href="javascript:void(0);"
576 i18n-content="enable"
577 >ENABLE</a>
578 </span>
579 </td>
580 </tr></table></div>
581 <table><tr jsdisplay="mimeTypes.length > 0">
582 <td class="plugin-details-label"
583 i18n-content="pluginMimeTypes">MIME_TYPES:</td>
584 <td><table width="100%" class="mime-types">
585 <tr class="header">
586 <td i18n-content="pluginMimeTypesMimeType"
587 >MIME type</td>
588 <td i18n-content="pluginMimeTypesDescription"
589 >DESCRIPTION</td>
590 <td i18n-content="pluginMimeTypesFileExtensions"
591 >FILE_EXTENSIONS</td>
592 </tr>
593 <tr jsselect="mimeTypes">
594 <td><span dir="ltr"
595 jscontent="mimeType"></span></td>
596 <td><span dir="ltr"
597 jsvalues=".innerHTML:description"></span></td>
598 <td><table jsdisplay="fileExtensions.length > 0"
599 class="hlisting">
600 <tr><td jsselect="fileExtensions">
601 <span dir="ltr" jscontent="'.' + $this">
602 </td></tr>
603 </table></td>
604 </tr>
605 </table></td>
606 </tr></table>
607 </div>
529 </div> 608 </div>
530 </div> 609 </div>
531 </div> 610 </div>
532
533 <div class="plugin-actions"> 611 <div class="plugin-actions">
534 <span> 612 <span>
535 <a 613 <a
536 jsvalues=".pluginPath:path" 614 jsvalues=".path:name"
537 jsdisplay="enabled" 615 jsdisplay="enabled"
538 onclick="handleEnablePlugin(this, false)" 616 onclick="handleEnablePlugin(this, false, true)"
539 href="javascript:void();" 617 href="javascript:void(0);"
540 i18n-content="disable" 618 i18n-content="disable"
541 >DISABLE</a> 619 >DISABLE</a>
542 <a 620 <a
543 jsvalues=".pluginPath:path" 621 jsvalues=".path:name"
544 jsdisplay="!enabled" 622 jsdisplay="!enabled"
545 onclick="handleEnablePlugin(this, true)" 623 onclick="handleEnablePlugin(this, true, true)"
546 href="javascript:void();" 624 href="javascript:void(0);"
547 i18n-content="enable" 625 i18n-content="enable"
548 >ENABLE</a> 626 >ENABLE</a>
549 </span> 627 </span>
550 </div> 628 </div>
551 </td> 629 </td>
552 </tr> 630 </tr>
553 </table> 631 </table>
554 </div> 632 </div>
555 </div> 633 </div>
556 </div> 634 </div>
557 </div> 635 </div>
558 </div> 636 </div>
559 </body> 637 </body>
560 </html> 638 </html>
OLDNEW
« no previous file with comments | « chrome/browser/plugin_updater_unittest.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698