OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/macros.h" |
5 #include "components/omnibox/browser/autocomplete_match_type.h" | 6 #include "components/omnibox/browser/autocomplete_match_type.h" |
6 | 7 |
7 #include "base/basictypes.h" | |
8 | |
9 // static | 8 // static |
10 std::string AutocompleteMatchType::ToString(AutocompleteMatchType::Type type) { | 9 std::string AutocompleteMatchType::ToString(AutocompleteMatchType::Type type) { |
11 const char* strings[] = { | 10 const char* strings[] = { |
12 "url-what-you-typed", | 11 "url-what-you-typed", |
13 "history-url", | 12 "history-url", |
14 "history-title", | 13 "history-title", |
15 "history-body", | 14 "history-body", |
16 "history-keyword", | 15 "history-keyword", |
17 "navsuggest", | 16 "navsuggest", |
18 "search-what-you-typed", | 17 "search-what-you-typed", |
19 "search-history", | 18 "search-history", |
20 "search-suggest", | 19 "search-suggest", |
21 "search-suggest-entity", | 20 "search-suggest-entity", |
22 "search-suggest-infinite", | 21 "search-suggest-infinite", |
23 "search-suggest-personalized", | 22 "search-suggest-personalized", |
24 "search-suggest-profile", | 23 "search-suggest-profile", |
25 "search-other-engine", | 24 "search-other-engine", |
26 "extension-app", | 25 "extension-app", |
27 "contact", | 26 "contact", |
28 "bookmark-title", | 27 "bookmark-title", |
29 "navsuggest-personalized", | 28 "navsuggest-personalized", |
30 "search-calculator-answer", | 29 "search-calculator-answer", |
31 "url-from-clipboard", | 30 "url-from-clipboard", |
32 "voice-suggest" | 31 "voice-suggest" |
33 }; | 32 }; |
34 static_assert(arraysize(strings) == AutocompleteMatchType::NUM_TYPES, | 33 static_assert(arraysize(strings) == AutocompleteMatchType::NUM_TYPES, |
35 "strings array must have NUM_TYPES elements"); | 34 "strings array must have NUM_TYPES elements"); |
36 return strings[type]; | 35 return strings[type]; |
37 } | 36 } |
OLD | NEW |