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

Unified Diff: chrome/browser/ui/webui/ntp/ntp_user_data_logger.h

Issue 102433009: Most visited iframe now postMessage to signal the iframing page that the link has been displayed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed support for multiple thumbnail URLs, refactored UMA logging. Created 6 years, 11 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/ui/webui/ntp/ntp_user_data_logger.h
diff --git a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.h b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.h
index 5ca5f40b459893973c14c370dc0310bb262f1ac3..91047331f1b7c3ebe83b9ec10d007ebf6a8df222 100644
--- a/chrome/browser/ui/webui/ntp/ntp_user_data_logger.h
+++ b/chrome/browser/ui/webui/ntp/ntp_user_data_logger.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_
#define CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_
+#include "base/gtest_prod_util.h"
#include "chrome/common/ntp_logging_events.h"
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
@@ -23,11 +24,6 @@ class NTPUserDataLogger
static NTPUserDataLogger* GetOrCreateFromWebContents(
content::WebContents* content);
- // Logs the error percentage rate when loading thumbnail images for this NTP
- // session to UMA histogram. Called when the user navigates to a URL. Only
- // called for the instant NTP.
- void EmitThumbnailErrorRate();
-
// Logs a number of statistics regarding the NTP. Called when an NTP tab is
// about to be deactivated (be it by switching tabs, losing focus or closing
// the tab/shutting down Chrome), or when the user navigates to a URL.
@@ -45,17 +41,19 @@ class NTPUserDataLogger
const content::LoadCommittedDetails& load_details) OVERRIDE;
protected:
+ FRIEND_TEST_ALL_PREFIXES(NTPUserDataLoggerTest, TestLogging);
Evan Stade 2014/01/09 00:45:42 if this is just for the constructor, I'd prefer yo
beaudoin 2014/01/15 23:39:56 Done.
explicit NTPUserDataLogger(content::WebContents* contents);
- // Returns the percent error given |events| occurrences and |errors| errors.
- virtual size_t GetPercentError(size_t errors, size_t events) const;
-
private:
friend class content::WebContentsUserData<NTPUserDataLogger>;
// Total number of mouseovers for this NTP session.
size_t number_of_mouseovers_;
+ // Total number of tiles rendered, no matter if it's a thumbnail, a gray tile
+ // or an external tile.
+ size_t number_of_tiles_;
+
// Total number of attempts made to load thumbnail images for this NTP
// session.
size_t number_of_thumbnail_attempts_;
@@ -65,18 +63,22 @@ class NTPUserDataLogger
// of a thumbnail image.
size_t number_of_thumbnail_errors_;
- // Total number of attempts made to load thumbnail images while providing a
- // fallback thumbnail for this NTP session.
- size_t number_of_fallback_thumbnails_requested_;
+ // The number of times a gray tile with the domain was used as the fallback
+ // for a failed thumbnail.
+ size_t number_of_gray_tile_fallbacks_;
- // Total number of errors that occurred while trying to load the primary
- // thumbnail image and that caused a fallback to the secondary thumbnail.
- size_t number_of_fallback_thumbnails_used_;
+ // The number of times an external tile, for which the visual appearance is
+ // handled by the page itself, was the fallback for a failed thumbnail.
+ size_t number_of_external_fallbacks_;
// Total number of tiles for which the visual appearance is handled externally
// by the page itself.
size_t number_of_external_tiles_;
+ // Total number of tiles for which no thumbnail is specified and a gray tile
+ // with the domain is used as the main tile.
+ size_t number_of_gray_tiles_;
Evan Stade 2014/01/09 00:45:42 can you make the order of these member variables m
beaudoin 2014/01/15 23:39:56 I cleaned the enums up, used more uniform names an
+
// True if at least one iframe came from a server-side suggestion. In
// practice, either all the iframes are server-side suggestions or none are.
bool server_side_suggestions_;

Powered by Google App Engine
This is Rietveld 408576698