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

Side by Side Diff: components/dom_distiller/content/resources/dom_distiller_viewer.js

Issue 502653002: Add UMA metric for "View Original" link clicks in distilled page viewer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 function addToPage(html) { 5 function addToPage(html) {
6 var div = document.createElement('div'); 6 var div = document.createElement('div');
7 div.innerHTML = html; 7 div.innerHTML = html;
8 document.getElementById('content').appendChild(div); 8 document.getElementById('content').appendChild(div);
9 } 9 }
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 this.colorShuffle = setInterval(function() { 58 this.colorShuffle = setInterval(function() {
59 colorIndex = (colorIndex + 1) % colors.length; 59 colorIndex = (colorIndex + 1) % colors.length;
60 loader.className = colors[colorIndex]; 60 loader.className = colors[colorIndex];
61 }, 600); 61 }, 600);
62 } 62 }
63 } else if (isLastPage && typeof this.colorShuffle != "undefined") { 63 } else if (isLastPage && typeof this.colorShuffle != "undefined") {
64 clearInterval(this.colorShuffle); 64 clearInterval(this.colorShuffle);
65 } 65 }
66 }; 66 };
67 }(); 67 }();
68
69 // Add a listener to the "View Original" link to report opt-outs.
70 document.getElementById('showOriginal').addEventListener('click', function(e) {
71 var img = document.createElement('img');
72 img.src = "/vieworiginal";
nyquist 2014/08/25 01:13:03 Would this ever show up as an ugly visual artifact
Yaron 2014/08/25 19:41:23 Hmm. I suppose it's possible. Added display:none.
73 document.body.appendChild(img);
nyquist 2014/08/25 01:13:03 Since the click will navigate away, could there be
Yaron 2014/08/25 19:41:23 I don't think so. Remember that the backend is alw
nyquist 2014/08/25 20:09:19 Right, I think I was just concerned that the netwo
74 }, true);
75
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698