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

Side by Side Diff: chrome/renderer/searchbox/searchbox.cc

Issue 1007383003: Adds a new UMA histogram to measure the NTP load time since navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 #include "chrome/renderer/searchbox/searchbox.h" 5 #include "chrome/renderer/searchbox/searchbox.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 query_(), 155 query_(),
156 start_margin_(0) { 156 start_margin_(0) {
157 } 157 }
158 158
159 SearchBox::~SearchBox() { 159 SearchBox::~SearchBox() {
160 } 160 }
161 161
162 void SearchBox::LogEvent(NTPLoggingEventType event) { 162 void SearchBox::LogEvent(NTPLoggingEventType event) {
163 // navigation_start in ms. 163 // navigation_start in ms.
164 uint64 start = 1000 * 164 uint64 start = 1000 *
165 render_view() 165 render_view()
166 ->GetMainRenderFrame() 166 ->GetMainRenderFrame()
167 ->GetWebFrame() 167 ->GetWebFrame()
168 ->performance() 168 ->performance()
169 .navigationStart(); 169 .navigationStart();
170 uint64 now = 170 uint64 now =
171 (base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InMilliseconds(); 171 (base::TimeTicks::Now() - base::TimeTicks::UnixEpoch()).InMilliseconds();
172 DCHECK(now >= start); 172 DCHECK(now >= start);
173 uint64 delta = now - start; 173 uint64 delta = now - start;
174 render_view()->Send(new ChromeViewHostMsg_LogEvent( 174 render_view()->Send(new ChromeViewHostMsg_LogEvent(
175 render_view()->GetRoutingID(), page_seq_no_, event, delta)); 175 render_view()->GetRoutingID(), page_seq_no_, event, delta));
176 } 176 }
177 177
178 void SearchBox::LogMostVisitedImpression(int position, 178 void SearchBox::LogMostVisitedImpression(int position,
179 const base::string16& provider) { 179 const base::string16& provider) {
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 498
499 void SearchBox::Reset() { 499 void SearchBox::Reset() {
500 query_.clear(); 500 query_.clear();
501 embedded_search_request_params_ = EmbeddedSearchRequestParams(); 501 embedded_search_request_params_ = EmbeddedSearchRequestParams();
502 suggestion_ = InstantSuggestion(); 502 suggestion_ = InstantSuggestion();
503 start_margin_ = 0; 503 start_margin_ = 0;
504 is_focused_ = false; 504 is_focused_ = false;
505 is_key_capture_enabled_ = false; 505 is_key_capture_enabled_ = false;
506 theme_info_ = ThemeBackgroundInfo(); 506 theme_info_ = ThemeBackgroundInfo();
507 } 507 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698