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

Side by Side Diff: components/omnibox/browser/zero_suggest_provider.cc

Issue 2725333004: Omnibox - Cleanup From Recent Changelists (Closed)
Patch Set: DCHECK(done_) Created 3 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
« no previous file with comments | « components/omnibox/browser/search_provider.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "components/omnibox/browser/zero_suggest_provider.h" 5 #include "components/omnibox/browser/zero_suggest_provider.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 void LogOmniboxZeroSuggestRequest( 74 void LogOmniboxZeroSuggestRequest(
75 ZeroSuggestRequestsHistogramValue request_value) { 75 ZeroSuggestRequestsHistogramValue request_value) {
76 UMA_HISTOGRAM_ENUMERATION("Omnibox.ZeroSuggestRequests", request_value, 76 UMA_HISTOGRAM_ENUMERATION("Omnibox.ZeroSuggestRequests", request_value,
77 ZERO_SUGGEST_MAX_REQUEST_HISTOGRAM_VALUE); 77 ZERO_SUGGEST_MAX_REQUEST_HISTOGRAM_VALUE);
78 } 78 }
79 79
80 // Relevance value to use if it was not set explicitly by the server. 80 // Relevance value to use if it was not set explicitly by the server.
81 const int kDefaultZeroSuggestRelevance = 100; 81 const int kDefaultZeroSuggestRelevance = 100;
82 82
83 // Used for testing whether zero suggest is ever available. 83 // Used for testing whether zero suggest is ever available.
84 const char kArbitraryInsecureUrlString[] = "http://www.google.com/"; 84 constexpr char kArbitraryInsecureUrlString[] = "http://www.google.com/";
85 85
86 } // namespace 86 } // namespace
87 87
88 // static 88 // static
89 ZeroSuggestProvider* ZeroSuggestProvider::Create( 89 ZeroSuggestProvider* ZeroSuggestProvider::Create(
90 AutocompleteProviderClient* client, 90 AutocompleteProviderClient* client,
91 HistoryURLProvider* history_url_provider, 91 HistoryURLProvider* history_url_provider,
92 AutocompleteProviderListener* listener) { 92 AutocompleteProviderListener* listener) {
93 return new ZeroSuggestProvider(client, history_url_provider, listener); 93 return new ZeroSuggestProvider(client, history_url_provider, listener);
94 } 94 }
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
545 if (!json_data.empty()) { 545 if (!json_data.empty()) {
546 std::unique_ptr<base::Value> data( 546 std::unique_ptr<base::Value> data(
547 SearchSuggestionParser::DeserializeJsonData(json_data)); 547 SearchSuggestionParser::DeserializeJsonData(json_data));
548 if (data && ParseSuggestResults( 548 if (data && ParseSuggestResults(
549 *data, kDefaultZeroSuggestRelevance, false, &results_)) { 549 *data, kDefaultZeroSuggestRelevance, false, &results_)) {
550 ConvertResultsToAutocompleteMatches(); 550 ConvertResultsToAutocompleteMatches();
551 results_from_cache_ = !matches_.empty(); 551 results_from_cache_ = !matches_.empty();
552 } 552 }
553 } 553 }
554 } 554 }
OLDNEW
« no previous file with comments | « components/omnibox/browser/search_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698