| OLD | NEW | 
|    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 "chrome/browser/autocomplete/zero_suggest_provider.h" |    5 #include "components/omnibox/zero_suggest_provider.h" | 
|    6  |    6  | 
|    7 #include "base/callback.h" |    7 #include "base/callback.h" | 
|    8 #include "base/i18n/case_conversion.h" |    8 #include "base/i18n/case_conversion.h" | 
|    9 #include "base/json/json_string_value_serializer.h" |    9 #include "base/json/json_string_value_serializer.h" | 
|   10 #include "base/metrics/histogram.h" |   10 #include "base/metrics/histogram.h" | 
|   11 #include "base/metrics/user_metrics.h" |   11 #include "base/metrics/user_metrics.h" | 
|   12 #include "base/prefs/pref_service.h" |   12 #include "base/prefs/pref_service.h" | 
|   13 #include "base/strings/string16.h" |   13 #include "base/strings/string16.h" | 
|   14 #include "base/strings/string_util.h" |   14 #include "base/strings/string_util.h" | 
|   15 #include "base/strings/utf_string_conversions.h" |   15 #include "base/strings/utf_string_conversions.h" | 
|   16 #include "base/time/time.h" |   16 #include "base/time/time.h" | 
|   17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |  | 
|   18 #include "components/history/core/browser/history_types.h" |   17 #include "components/history/core/browser/history_types.h" | 
|   19 #include "components/history/core/browser/top_sites.h" |   18 #include "components/history/core/browser/top_sites.h" | 
|   20 #include "components/metrics/proto/omnibox_input_type.pb.h" |   19 #include "components/metrics/proto/omnibox_input_type.pb.h" | 
 |   20 #include "components/omnibox/autocomplete_classifier.h" | 
|   21 #include "components/omnibox/autocomplete_input.h" |   21 #include "components/omnibox/autocomplete_input.h" | 
|   22 #include "components/omnibox/autocomplete_match.h" |   22 #include "components/omnibox/autocomplete_match.h" | 
|   23 #include "components/omnibox/autocomplete_provider_listener.h" |   23 #include "components/omnibox/autocomplete_provider_listener.h" | 
|   24 #include "components/omnibox/history_url_provider.h" |   24 #include "components/omnibox/history_url_provider.h" | 
|   25 #include "components/omnibox/omnibox_field_trial.h" |   25 #include "components/omnibox/omnibox_field_trial.h" | 
|   26 #include "components/omnibox/omnibox_pref_names.h" |   26 #include "components/omnibox/omnibox_pref_names.h" | 
|   27 #include "components/omnibox/search_provider.h" |   27 #include "components/omnibox/search_provider.h" | 
|   28 #include "components/pref_registry/pref_registry_syncable.h" |   28 #include "components/pref_registry/pref_registry_syncable.h" | 
|   29 #include "components/search_engines/template_url_service.h" |   29 #include "components/search_engines/template_url_service.h" | 
|   30 #include "components/variations/net/variations_http_header_provider.h" |   30 #include "components/variations/net/variations_http_header_provider.h" | 
| (...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  471   if (!json_data.empty()) { |  471   if (!json_data.empty()) { | 
|  472     scoped_ptr<base::Value> data( |  472     scoped_ptr<base::Value> data( | 
|  473         SearchSuggestionParser::DeserializeJsonData(json_data)); |  473         SearchSuggestionParser::DeserializeJsonData(json_data)); | 
|  474     if (data && ParseSuggestResults( |  474     if (data && ParseSuggestResults( | 
|  475             *data, kDefaultZeroSuggestRelevance, false, &results_)) { |  475             *data, kDefaultZeroSuggestRelevance, false, &results_)) { | 
|  476       ConvertResultsToAutocompleteMatches(); |  476       ConvertResultsToAutocompleteMatches(); | 
|  477       results_from_cache_ = !matches_.empty(); |  477       results_from_cache_ = !matches_.empty(); | 
|  478     } |  478     } | 
|  479   } |  479   } | 
|  480 } |  480 } | 
| OLD | NEW |