OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 5 #ifndef CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 6 #define CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 // Record a final status of a prerendered page in a histogram. | 49 // Record a final status of a prerendered page in a histogram. |
50 void RecordFinalStatus(Origin origin, | 50 void RecordFinalStatus(Origin origin, |
51 uint8 experiment_id, | 51 uint8 experiment_id, |
52 FinalStatus final_status) const; | 52 FinalStatus final_status) const; |
53 | 53 |
54 | 54 |
55 // To be called when a new prerender is added. | 55 // To be called when a new prerender is added. |
56 void RecordPrerender(Origin origin, const GURL& url); | 56 void RecordPrerender(Origin origin, const GURL& url); |
57 | 57 |
| 58 // Called when a prerender is added with an Omnibox origin. |
| 59 void RecordPrerenderFromOmnibox() const; |
| 60 |
| 61 // Called when we swap in a prerender. Checks if the origin is Omnibox before |
| 62 // recording the count. |
| 63 void RecordOmniboxUsedPrerender(Origin origin) const; |
| 64 |
58 private: | 65 private: |
59 base::TimeTicks GetCurrentTimeTicks() const; | 66 base::TimeTicks GetCurrentTimeTicks() const; |
60 | 67 |
61 // Returns the time elapsed since the last prerender happened. | 68 // Returns the time elapsed since the last prerender happened. |
62 base::TimeDelta GetTimeSinceLastPrerender() const; | 69 base::TimeDelta GetTimeSinceLastPrerender() const; |
63 | 70 |
64 // Returns whether the PrerenderManager is currently within the prerender | 71 // Returns whether the PrerenderManager is currently within the prerender |
65 // window - effectively, up to 30 seconds after a prerender tag has been | 72 // window - effectively, up to 30 seconds after a prerender tag has been |
66 // observed. | 73 // observed. |
67 bool WithinWindow() const; | 74 bool WithinWindow() const; |
(...skipping 27 matching lines...) Expand all Loading... |
95 // start recording events before the first prerender occurs. | 102 // start recording events before the first prerender occurs. |
96 bool seen_any_pageload_; | 103 bool seen_any_pageload_; |
97 bool seen_pageload_started_after_prerender_; | 104 bool seen_pageload_started_after_prerender_; |
98 | 105 |
99 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); | 106 DISALLOW_COPY_AND_ASSIGN(PrerenderHistograms); |
100 }; | 107 }; |
101 | 108 |
102 } // namespace prerender | 109 } // namespace prerender |
103 | 110 |
104 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ | 111 #endif // CHROME_BROWSER_PRERENDER_PRERENDER_HISTOGRAMS_H_ |
OLD | NEW |