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/autocomplete_match.h" | 5 #include "chrome/browser/autocomplete/autocomplete_match.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "chrome/browser/autocomplete/autocomplete.h" | 10 #include "chrome/browser/autocomplete/autocomplete.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 COMPILE_ASSERT(arraysize(strings) == NUM_TYPES, | 121 COMPILE_ASSERT(arraysize(strings) == NUM_TYPES, |
122 strings_array_must_match_type_enum); | 122 strings_array_must_match_type_enum); |
123 return strings[type]; | 123 return strings[type]; |
124 } | 124 } |
125 | 125 |
126 // static | 126 // static |
127 int AutocompleteMatch::TypeToIcon(Type type) { | 127 int AutocompleteMatch::TypeToIcon(Type type) { |
128 int icons[] = { | 128 int icons[] = { |
129 IDR_OMNIBOX_HTTP, | 129 IDR_OMNIBOX_HTTP, |
130 IDR_OMNIBOX_HTTP, | 130 IDR_OMNIBOX_HTTP, |
131 IDR_OMNIBOX_HISTORY, | 131 IDR_OMNIBOX_HTTP, |
132 IDR_OMNIBOX_HISTORY, | 132 IDR_OMNIBOX_HTTP, |
133 IDR_OMNIBOX_HISTORY, | 133 IDR_OMNIBOX_HTTP, |
134 IDR_OMNIBOX_HTTP, | 134 IDR_OMNIBOX_HTTP, |
135 IDR_OMNIBOX_SEARCH, | 135 IDR_OMNIBOX_SEARCH, |
136 IDR_OMNIBOX_SEARCH, | 136 IDR_OMNIBOX_SEARCH, |
137 IDR_OMNIBOX_SEARCH, | 137 IDR_OMNIBOX_SEARCH, |
138 IDR_OMNIBOX_SEARCH, | 138 IDR_OMNIBOX_SEARCH, |
139 IDR_OMNIBOX_EXTENSION_APP, | 139 IDR_OMNIBOX_EXTENSION_APP, |
140 }; | 140 }; |
141 COMPILE_ASSERT(arraysize(icons) == NUM_TYPES, | 141 COMPILE_ASSERT(arraysize(icons) == NUM_TYPES, |
142 icons_array_must_match_type_enum); | 142 icons_array_must_match_type_enum); |
143 return icons[type]; | 143 return icons[type]; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 << " is unsorted in relation to last offset of " << last_offset | 341 << " is unsorted in relation to last offset of " << last_offset |
342 << ". Provider: " << (provider ? provider->name() : "None") << "."; | 342 << ". Provider: " << (provider ? provider->name() : "None") << "."; |
343 DCHECK_LT(i->offset, text.length()) | 343 DCHECK_LT(i->offset, text.length()) |
344 << " Classification of [" << i->offset << "," << text.length() | 344 << " Classification of [" << i->offset << "," << text.length() |
345 << "] is out of bounds for \"" << text << "\". Provider: " | 345 << "] is out of bounds for \"" << text << "\". Provider: " |
346 << (provider ? provider->name() : "None") << "."; | 346 << (provider ? provider->name() : "None") << "."; |
347 last_offset = i->offset; | 347 last_offset = i->offset; |
348 } | 348 } |
349 } | 349 } |
350 #endif | 350 #endif |
OLD | NEW |