OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 23 matching lines...) Expand all Loading... |
34 // Logs a number of statistics regarding the NTP. Called when an NTP tab is | 34 // Logs a number of statistics regarding the NTP. Called when an NTP tab is |
35 // about to be deactivated (be it by switching tabs, losing focus or closing | 35 // about to be deactivated (be it by switching tabs, losing focus or closing |
36 // the tab/shutting down Chrome), or when the user navigates to a URL. | 36 // the tab/shutting down Chrome), or when the user navigates to a URL. |
37 void EmitNtpStatistics(); | 37 void EmitNtpStatistics(); |
38 | 38 |
39 // Called when an event occurs on the NTP that requires a counter to be | 39 // Called when an event occurs on the NTP that requires a counter to be |
40 // incremented. |time| is the delta time in ms from navigation start until | 40 // incremented. |time| is the delta time in ms from navigation start until |
41 // this event happened. | 41 // this event happened. |
42 void LogEvent(NTPLoggingEventType event, base::TimeDelta time); | 42 void LogEvent(NTPLoggingEventType event, base::TimeDelta time); |
43 | 43 |
44 // Logs an impression on one of the Most Visited tiles by a given provider. | 44 // Logs an impression on one of the NTP tiles by a given source. |
45 void LogMostVisitedImpression(int position, const base::string16& provider); | 45 void LogMostVisitedImpression(int position, NTPLoggingTileSource tile_source); |
46 | 46 |
47 // Logs a navigation on one of the Most Visited tiles by a given provider. | 47 // Logs a navigation on one of the NTP tiles by a given source. |
48 void LogMostVisitedNavigation(int position, const base::string16& provider); | 48 void LogMostVisitedNavigation(int position, NTPLoggingTileSource tile_source); |
49 | 49 |
50 // content::WebContentsObserver override | 50 // content::WebContentsObserver override |
51 void NavigationEntryCommitted( | 51 void NavigationEntryCommitted( |
52 const content::LoadCommittedDetails& load_details) override; | 52 const content::LoadCommittedDetails& load_details) override; |
53 | 53 |
54 protected: | 54 protected: |
55 explicit NTPUserDataLogger(content::WebContents* contents); | 55 explicit NTPUserDataLogger(content::WebContents* contents); |
56 | 56 |
57 private: | 57 private: |
58 friend class content::WebContentsUserData<NTPUserDataLogger>; | 58 friend class content::WebContentsUserData<NTPUserDataLogger>; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 // Are stats being logged during Chrome startup? | 108 // Are stats being logged during Chrome startup? |
109 bool during_startup_; | 109 bool during_startup_; |
110 | 110 |
111 // The URL of this New Tab Page - varies based on NTP version. | 111 // The URL of this New Tab Page - varies based on NTP version. |
112 GURL ntp_url_; | 112 GURL ntp_url_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(NTPUserDataLogger); | 114 DISALLOW_COPY_AND_ASSIGN(NTPUserDataLogger); |
115 }; | 115 }; |
116 | 116 |
117 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ | 117 #endif // CHROME_BROWSER_UI_WEBUI_NTP_NTP_USER_DATA_LOGGER_H_ |
OLD | NEW |