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

Side by Side Diff: chrome/browser/autocomplete/search_provider.h

Issue 10832323: Adds a UMA histogram to monitor omnibox suggest requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reactored according to Ilya's suggestions. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // This file contains the Search autocomplete provider. This provider is 5 // This file contains the Search autocomplete provider. This provider is
6 // responsible for all non-keyword autocomplete entries that start with 6 // responsible for all non-keyword autocomplete entries that start with
7 // "Search <engine> for ...", including searching for the current input string, 7 // "Search <engine> for ...", including searching for the current input string,
8 // search history, and search suggestions. An instance of it gets created and 8 // search history, and search suggestions. An instance of it gets created and
9 // managed by the autocomplete controller. 9 // managed by the autocomplete controller.
10 10
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 bool is_keyword, 311 bool is_keyword,
312 MatchMap* map); 312 MatchMap* map);
313 313
314 // Returns an AutocompleteMatch for a navigational suggestion. 314 // Returns an AutocompleteMatch for a navigational suggestion.
315 AutocompleteMatch NavigationToMatch(const NavigationResult& navigation, 315 AutocompleteMatch NavigationToMatch(const NavigationResult& navigation,
316 bool is_keyword); 316 bool is_keyword);
317 317
318 // Updates the value of |done_| from the internal state. 318 // Updates the value of |done_| from the internal state.
319 void UpdateDone(); 319 void UpdateDone();
320 320
321 // We keep track in a histogram how many suggest requests we send,
322 // how many suggest requests we invalidate (e.g., due to a user typing
323 // another character), and how many replies we receive.
324 enum SuggestRequestsHistogramValue {
325 REQUEST_SENT = 1,
326 REQUEST_INVALIDATED = 2,
327 REPLY_RECEIVED = 3,
328 MAX_SUGGEST_REQUEST_HISTOGRAM_VALUE = 4
Ilya Sherman 2012/08/15 23:17:37 Optional nit: Explicitly specifying "4" here means
Mark P 2012/08/15 23:28:30 Done. I thought of this at the time and then forg
329 };
330 // Increments the appropriate value in the histogram by one.
msw 2012/08/15 23:21:51 nit: blank line to separate enum/function decls.
Mark P 2012/08/15 23:28:30 Done.
331 static void LogOmniboxSuggestRequest(
332 const SuggestRequestsHistogramValue request_value);
Ilya Sherman 2012/08/15 23:17:37 nit: No need to declare the parameter as const, si
Ilya Sherman 2012/08/15 23:17:37 nit: I would move both of these definitions into a
Mark P 2012/08/15 23:28:30 Fixed in process of move to .cc file.
Mark P 2012/08/15 23:28:30 Moved. (I don't need this function & type exporte
333
321 // Should we query for suggest results immediately? This is normally false, 334 // Should we query for suggest results immediately? This is normally false,
322 // but may be set to true during testing. 335 // but may be set to true during testing.
323 static bool query_suggest_immediately_; 336 static bool query_suggest_immediately_;
324 337
325 // Maintains the TemplateURLs used. 338 // Maintains the TemplateURLs used.
326 Providers providers_; 339 Providers providers_;
327 340
328 // The user's input. 341 // The user's input.
329 AutocompleteInput input_; 342 AutocompleteInput input_;
330 343
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // Has FinalizeInstantQuery been invoked since the last |Start|? 388 // Has FinalizeInstantQuery been invoked since the last |Start|?
376 bool instant_finalized_; 389 bool instant_finalized_;
377 390
378 // The |suggest_text| parameter passed to FinalizeInstantQuery. 391 // The |suggest_text| parameter passed to FinalizeInstantQuery.
379 string16 default_provider_suggest_text_; 392 string16 default_provider_suggest_text_;
380 393
381 DISALLOW_COPY_AND_ASSIGN(SearchProvider); 394 DISALLOW_COPY_AND_ASSIGN(SearchProvider);
382 }; 395 };
383 396
384 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_ 397 #endif // CHROME_BROWSER_AUTOCOMPLETE_SEARCH_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autocomplete/search_provider.cc » ('j') | chrome/browser/autocomplete/search_provider.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698