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

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

Issue 2733873002: Third-party NTPs: Set "instant support" flag earlier. (Closed)
Patch Set: review 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..d7dc58d868b1b5be53782e00e699f568147b61df 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}
*/
@@ -212,6 +226,11 @@ function fillMostVisited(location, fill) {
};
} else {
var apiHandle = chrome.embeddedSearch.newTabPage;
+ // 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
+ // tab to true, which makes later calls to fetch the most visited items
+ // succeed.
+ apiHandle.logEvent(NTP_LOGGING_EVENT_TYPE.NTP_ALL_TILES_RECEIVED);
data = apiHandle.getMostVisitedItemData(params.rid);
if (!data)
return;
« 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