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

Unified Diff: chrome/browser/resources/snippets_internals.js

Issue 2346263002: Extending the UserClassifier to actually support classification. (Closed)
Patch Set: Bernhard's comments Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/snippets_internals.js
diff --git a/chrome/browser/resources/snippets_internals.js b/chrome/browser/resources/snippets_internals.js
index c1ecb6b4302e147bac689f470571566cca2d013e..2bc16294c941bf3689447fedb5a7ea712493018b 100644
--- a/chrome/browser/resources/snippets_internals.js
+++ b/chrome/browser/resources/snippets_internals.js
@@ -28,6 +28,11 @@ cr.define('chrome.SnippetsInternals', function() {
event.preventDefault();
});
+ $('clear-classification').addEventListener('click', function(event) {
+ chrome.send('clearClassification');
+ event.preventDefault();
+ });
+
window.addEventListener('focus', refreshContent);
window.setInterval(refreshContent, 1000);
@@ -109,6 +114,14 @@ cr.define('chrome.SnippetsInternals', function() {
}
}
+ function receiveClassification(
+ userClass, timeToOpenNTP, timeToShow, timeToUse) {
+ receiveProperty('user-class', userClass);
+ receiveProperty('avg-time-to-open-ntp', timeToOpenNTP);
+ receiveProperty('avg-time-to-show', timeToShow);
+ receiveProperty('avg-time-to-use', timeToUse);
+ }
+
function downloadJson(json) {
// Redirect the browser to download data in |json| as a file "snippets.json"
// (Setting Content-Disposition: attachment via a data: URL is not possible;
@@ -159,6 +172,7 @@ cr.define('chrome.SnippetsInternals', function() {
receiveHosts: receiveHosts,
receiveContentSuggestions: receiveContentSuggestions,
receiveJson: receiveJson,
+ receiveClassification: receiveClassification,
};
});
« no previous file with comments | « chrome/browser/resources/snippets_internals.html ('k') | chrome/browser/ui/webui/snippets_internals_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698