OLD | NEW |
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 "components/omnibox/browser/search_provider.h" | 5 #include "components/omnibox/browser/search_provider.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <cmath> | 10 #include <cmath> |
9 | 11 |
10 #include "base/base64.h" | 12 #include "base/base64.h" |
11 #include "base/bind.h" | 13 #include "base/bind.h" |
12 #include "base/callback.h" | 14 #include "base/callback.h" |
13 #include "base/i18n/break_iterator.h" | 15 #include "base/i18n/break_iterator.h" |
14 #include "base/i18n/case_conversion.h" | 16 #include "base/i18n/case_conversion.h" |
15 #include "base/json/json_string_value_serializer.h" | 17 #include "base/json/json_string_value_serializer.h" |
16 #include "base/metrics/histogram_macros.h" | 18 #include "base/metrics/histogram_macros.h" |
(...skipping 1486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) | 1505 for (MatchMap::const_iterator i(map.begin()); i != map.end(); ++i) |
1504 matches.push_back(i->second); | 1506 matches.push_back(i->second); |
1505 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); | 1507 std::sort(matches.begin(), matches.end(), &AutocompleteMatch::MoreRelevant); |
1506 | 1508 |
1507 // If there is a top scoring entry, find the corresponding answer. | 1509 // If there is a top scoring entry, find the corresponding answer. |
1508 if (!matches.empty()) | 1510 if (!matches.empty()) |
1509 return answers_cache_.GetTopAnswerEntry(matches[0].contents); | 1511 return answers_cache_.GetTopAnswerEntry(matches[0].contents); |
1510 | 1512 |
1511 return AnswersQueryData(); | 1513 return AnswersQueryData(); |
1512 } | 1514 } |
OLD | NEW |