OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; | 5 package org.chromium.chrome.browser.compositor.bottombar.contextualsearch; |
6 | 6 |
7 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; | 7 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.PanelState; |
8 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange Reason; | 8 import org.chromium.chrome.browser.compositor.bottombar.OverlayPanel.StateChange Reason; |
9 import org.chromium.chrome.browser.contextualsearch.ContextualSearchUma; | 9 import org.chromium.chrome.browser.contextualsearch.ContextualSearchUma; |
10 | 10 |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
180 // Already opened, log how long it took. | 180 // Already opened, log how long it took. |
181 assert mSearchViewStartTimeNs != 0; | 181 assert mSearchViewStartTimeNs != 0; |
182 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 100 0000; | 182 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 100 0000; |
183 logSearchPanelLoadDuration(wasPrefetch, durationMs); | 183 logSearchPanelLoadDuration(wasPrefetch, durationMs); |
184 } | 184 } |
185 | 185 |
186 // Not yet opened, wait till an open to log. | 186 // Not yet opened, wait till an open to log. |
187 mIsSearchPanelFullyPreloaded = true; | 187 mIsSearchPanelFullyPreloaded = true; |
188 } | 188 } |
189 | 189 |
190 public void onSearchTermResolved() { | |
pedro (no code reviews)
2016/02/26 22:30:09
Nit: JavaDoc
Donn Denman
2016/02/27 00:18:39
Done.
| |
191 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 1000000 ; | |
192 ContextualSearchUma.logSearchTermResolution(durationMs); | |
193 } | |
194 | |
195 public void onSearchResultsViewable(boolean didResolve) { | |
pedro (no code reviews)
2016/02/26 22:30:09
Nit: JavaDoc
Donn Denman
2016/02/27 00:18:39
Done.
| |
196 long durationMs = (System.nanoTime() - mSearchViewStartTimeNs) / 1000000 ; | |
197 ContextualSearchUma.logSearchResultsViewable(durationMs, didResolve); | |
198 } | |
199 | |
190 /** | 200 /** |
191 * Records timing information when the search panel has been viewed for the first time. | 201 * Records timing information when the search panel has been viewed for the first time. |
192 */ | 202 */ |
193 private void onSearchPanelFirstView() { | 203 private void onSearchPanelFirstView() { |
194 if (mIsSearchPanelFullyPreloaded) { | 204 if (mIsSearchPanelFullyPreloaded) { |
195 // Already fully pre-loaded, record a wait of 0 milliseconds. | 205 // Already fully pre-loaded, record a wait of 0 milliseconds. |
196 logSearchPanelLoadDuration(true, 0); | 206 logSearchPanelLoadDuration(true, 0); |
197 } else { | 207 } else { |
198 // Start a loading timer. | 208 // Start a loading timer. |
199 mSearchViewStartTimeNs = System.nanoTime(); | 209 mSearchViewStartTimeNs = System.nanoTime(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
236 /** | 246 /** |
237 * Logs the duration the user waited for the search panel to fully load, onc e it was opened. | 247 * Logs the duration the user waited for the search panel to fully load, onc e it was opened. |
238 * @param wasPrefetch Whether the load included prefetch. | 248 * @param wasPrefetch Whether the load included prefetch. |
239 * @param durationMs The duration to log. | 249 * @param durationMs The duration to log. |
240 */ | 250 */ |
241 private void logSearchPanelLoadDuration(boolean wasPrefetch, long durationMs ) { | 251 private void logSearchPanelLoadDuration(boolean wasPrefetch, long durationMs ) { |
242 ContextualSearchUma.logSearchPanelLoadDuration(wasPrefetch, durationMs); | 252 ContextualSearchUma.logSearchPanelLoadDuration(wasPrefetch, durationMs); |
243 } | 253 } |
244 } | 254 } |
245 | 255 |
OLD | NEW |