Commit aef2496d authored by Eric Lawrence's avatar Eric Lawrence Committed by Commit Bot

Show recording indicator on NetLog Export tab

We should show an indicator in the NetLog tab title to help remind
users that their browsing traffic is being recorded.

Change-Id: Ia1d2fb5b25c43d39084518656a79884f6149d3cc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2460856
Commit-Queue: Eric Lawrence [MSFT] <ericlaw@microsoft.com>
Reviewed-by: default avatarEric Roman <eroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815281}
parent 2fa5ea5c
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<script src="chrome://net-export/net_export.js"></script> <script src="chrome://net-export/net_export.js"></script>
<link rel="stylesheet" href="chrome://resources/css/text_defaults.css"> <link rel="stylesheet" href="chrome://resources/css/text_defaults.css">
<link rel="stylesheet" href="net_export.css"> <link rel="stylesheet" href="net_export.css">
<link rel="icon" id="fav-icon">
<title>Network Log Export</title> <title>Network Log Export</title>
</head> </head>
<body> <body>
......
...@@ -210,7 +210,10 @@ const NetExportView = (function() { ...@@ -210,7 +210,10 @@ const NetExportView = (function() {
*/ */
renderLogging_(info) { renderLogging_(info) {
this.showStateDiv_(kIdStateDivLogging); this.showStateDiv_(kIdStateDivLogging);
this.setFavicon_(
'data:image/svg+xml,<svg version="1.1" ' +
'xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32">' +
'<circle cx="16" cy="16" r="14" fill="red" stroke="black" /></svg>');
$(kIdStopLoggingButton).onclick = this.onStopLogging_.bind(this); $(kIdStopLoggingButton).onclick = this.onStopLogging_.bind(this);
$(kIdCaptureModeLogging).textContent = this.getCaptureModeText_(info); $(kIdCaptureModeLogging).textContent = this.getCaptureModeText_(info);
$(kIdFilePathLogging).textContent = info.file; $(kIdFilePathLogging).textContent = info.file;
...@@ -220,6 +223,7 @@ const NetExportView = (function() { ...@@ -220,6 +223,7 @@ const NetExportView = (function() {
* Updates the UI to display the state when logging has stopped. * Updates the UI to display the state when logging has stopped.
*/ */
renderStoppedLogging_(info) { renderStoppedLogging_(info) {
this.setFavicon_('data:image/x-icon;base64,');
this.showStateDiv_(kIdStateDivStopped); this.showStateDiv_(kIdStateDivStopped);
// The email button is only available in the mobile UI. // The email button is only available in the mobile UI.
...@@ -287,6 +291,13 @@ const NetExportView = (function() { ...@@ -287,6 +291,13 @@ const NetExportView = (function() {
$(curDivId).hidden = divId !== curDivId; $(curDivId).hidden = divId !== curDivId;
} }
}, },
/**
* Sets the icon for the tab to reflect current capturing state.
*/
setFavicon_(dataUrl) {
document.getElementById('fav-icon').href = dataUrl;
}
}; };
return NetExportView; return NetExportView;
......
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