Commit 0867089c authored by Kai Ninomiya's avatar Kai Ninomiya Committed by Commit Bot

about:gpu: fix blacklist urls on CrOS, and add "copy to clipboard" button

Makes a few updates to about:gpu.

* Add a "Copy to Clipboard" button, and removes the "To properly save
  this page" instructions. (797440)
* Fixes blacklist URLs on CrOS: fall back to the 0.0.0.0 version
  identifier whenever the 40-char hash is not available. (786605)
* Print the date in ISO format, rather than localized format, so that
  Chrome developers will be able to read it consistently. (no bug)

Bug: 786605
Bug: 797440
Change-Id: I6ab25b19248c49e8ba16bedad5060a48dc16b8b8
Reviewed-on: https://chromium-review.googlesource.com/846283Reviewed-by: default avatarKenneth Russell <kbr@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526505}
parent bd73ff10
...@@ -62,3 +62,7 @@ ...@@ -62,3 +62,7 @@
#info-view .feature-red { #info-view .feature-red {
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
} }
#copy-to-clipboard {
user-select: none;
}
...@@ -5,12 +5,7 @@ found in the LICENSE file. ...@@ -5,12 +5,7 @@ found in the LICENSE file.
--> -->
<tabpanel id="info-view"> <tabpanel id="info-view">
<div> <div>
<span> <input type="button" id="copy-to-clipboard" value="Copy Report to Clipboard">
<i>
Note: To properly save this page, select the "Webpage, Complete" option
in the Save File dialog.
</i>
</span>
</div> </div>
<div> <div>
<h3>Graphics Feature Status</h3> <h3>Graphics Feature Status</h3>
......
...@@ -27,6 +27,19 @@ cr.define('gpu', function() { ...@@ -27,6 +27,19 @@ cr.define('gpu', function() {
this.refresh.bind(this)); this.refresh.bind(this));
browserBridge.addEventListener('clientInfoChange', browserBridge.addEventListener('clientInfoChange',
this.refresh.bind(this)); this.refresh.bind(this));
// Add handler to 'copy to clipboard' button
document.getElementById('copy-to-clipboard').onclick = function() {
// Make sure nothing is selected
window.getSelection().removeAllRanges();
document.execCommand('selectAll');
document.execCommand('copy');
// And deselect everything at the end.
window.getSelection().removeAllRanges();
}
this.refresh(); this.refresh();
}, },
...@@ -35,8 +48,12 @@ cr.define('gpu', function() { ...@@ -35,8 +48,12 @@ cr.define('gpu', function() {
*/ */
refresh: function(data) { refresh: function(data) {
function createSourcePermalink(revisionIdentifier, filepath) { function createSourcePermalink(revisionIdentifier, filepath) {
return 'https://chromium.googlesource.com/chromium/src/+/' + if (revisionIdentifier.length !== 40) {
revisionIdentifier + '/' + filepath; // If the revision id isn't a hash, just use the 0.0.0.0 version
// from the Chrome version string "Chrome/0.0.0.0".
revisionIdentifier = clientInfo.version.split('/')[1];
}
return `https://chromium.googlesource.com/chromium/src/+/${revisionIdentifier}/${filepath}`;
} }
// Client info // Client info
...@@ -46,7 +63,7 @@ cr.define('gpu', function() { ...@@ -46,7 +63,7 @@ cr.define('gpu', function() {
this.setTable_('client-info', [ this.setTable_('client-info', [
{ {
description: 'Data exported', description: 'Data exported',
value: (new Date()).toLocaleString() value: (new Date()).toISOString()
}, },
{ {
description: 'Chrome version', description: 'Chrome version',
......
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