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 "components/omnibox/browser/zero_suggest_provider.h" | 5 #include "components/omnibox/browser/zero_suggest_provider.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include "base/callback.h" | 9 #include "base/callback.h" |
8 #include "base/i18n/case_conversion.h" | 10 #include "base/i18n/case_conversion.h" |
9 #include "base/json/json_string_value_serializer.h" | 11 #include "base/json/json_string_value_serializer.h" |
10 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
11 #include "base/metrics/user_metrics.h" | 13 #include "base/metrics/user_metrics.h" |
12 #include "base/prefs/pref_service.h" | 14 #include "base/prefs/pref_service.h" |
13 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
14 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
15 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
16 #include "base/time/time.h" | 18 #include "base/time/time.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 if (!json_data.empty()) { | 465 if (!json_data.empty()) { |
464 scoped_ptr<base::Value> data( | 466 scoped_ptr<base::Value> data( |
465 SearchSuggestionParser::DeserializeJsonData(json_data)); | 467 SearchSuggestionParser::DeserializeJsonData(json_data)); |
466 if (data && ParseSuggestResults( | 468 if (data && ParseSuggestResults( |
467 *data, kDefaultZeroSuggestRelevance, false, &results_)) { | 469 *data, kDefaultZeroSuggestRelevance, false, &results_)) { |
468 ConvertResultsToAutocompleteMatches(); | 470 ConvertResultsToAutocompleteMatches(); |
469 results_from_cache_ = !matches_.empty(); | 471 results_from_cache_ = !matches_.empty(); |
470 } | 472 } |
471 } | 473 } |
472 } | 474 } |
OLD | NEW |