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

Unified Diff: chrome/browser/resources/local_ntp/most_visited_util.js

Issue 2733873002: Third-party NTPs: Set "instant support" flag earlier. (Closed)
Patch Set: comment Created 3 years, 9 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
« no previous file with comments | « no previous file | chrome/common/search/ntp_logging_events.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/local_ntp/most_visited_util.js
diff --git a/chrome/browser/resources/local_ntp/most_visited_util.js b/chrome/browser/resources/local_ntp/most_visited_util.js
index 5620d5f02468a648dabfe5f8028c4ab8ce664ebc..b05fad9df8c04cd689ba92491bd7f43bfd84eec7 100644
--- a/chrome/browser/resources/local_ntp/most_visited_util.js
+++ b/chrome/browser/resources/local_ntp/most_visited_util.js
@@ -7,10 +7,24 @@
* @fileoverview Utilities for rendering most visited thumbnails and titles.
*/
+// Don't remove; see crbug.com/678778.
// <include src="instant_iframe_validation.js">
/**
+ * The different types of events that are logged from the NTP. The multi-iframe
+ * version of the NTP does *not* actually log any statistics anymore; this is
+ * only required as a workaround for crbug.com/698675.
+ * Note: Keep in sync with common/ntp_logging_events.h
+ * @enum {number}
+ * @const
+ */
+var NTP_LOGGING_EVENT_TYPE = {
+ NTP_ALL_TILES_RECEIVED: 12,
+};
+
+
+/**
* The origin of this request.
* @const {string}
*/
@@ -200,6 +214,14 @@ function fillMostVisited(location, fill) {
params.rid = parseInt(params.rid, 10);
if (!isFinite(params.rid) && !params.url)
return;
+
+ // Note: This does not actually result in any logging; it's a workaround for
+ // crbug.com/698675. It effectively sets the "instant support" state of the
+ // page to true, which makes later calls to fetch the most visited items
sfiera 2017/03/06 15:48:01 "of the page": are we setting it for the page, or
Marc Treib 2017/03/06 18:59:18 It's a property of the whole Tab/WebContents, i.e.
sfiera 2017/03/07 15:07:59 Then, should the comment here read "state of the t
Marc Treib 2017/03/07 16:08:19 Done.
sfiera 2017/03/07 16:26:24 OK, so it sounds like "page supports Instant" is n
Marc Treib 2017/03/07 16:33:55 Well, the problem is really that "Instant" means d
+ // succeed.
+ chrome.embeddedSearch.newTabPage.logEvent(
+ NTP_LOGGING_EVENT_TYPE.NTP_ALL_TILES_RECEIVED);
sfiera 2017/03/06 15:48:01 Would it make more sense to put this right before
Marc Treib 2017/03/06 18:59:18 I haven't tried, but I think that's too late: This
sfiera 2017/03/07 15:07:59 It looks to me that the only things happening betw
Marc Treib 2017/03/07 16:08:19 D'oh, somehow I missed that that other call is jus
+
var data;
if (params.url) {
// Means that the suggestion data comes from the server. Create data object.
« no previous file with comments | « no previous file | chrome/common/search/ntp_logging_events.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698