| 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 "components/omnibox/browser/autocomplete_match.h" | 5 #include "components/omnibox/browser/autocomplete_match.h" |
| 6 | 6 |
| 7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // static | 225 // static |
| 226 gfx::VectorIconId AutocompleteMatch::TypeToVectorIcon(Type type) { | 226 gfx::VectorIconId AutocompleteMatch::TypeToVectorIcon(Type type) { |
| 227 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 227 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 228 static const gfx::VectorIconId kIcons[] = { | 228 static const gfx::VectorIconId kIcons[] = { |
| 229 gfx::VectorIconId::OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE | 229 gfx::VectorIconId::OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE |
| 230 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_URL | 230 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_URL |
| 231 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_TITLE | 231 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_TITLE |
| 232 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_BODY | 232 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_BODY |
| 233 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_KEYWORD | 233 gfx::VectorIconId::OMNIBOX_HTTP, // HISTORY_KEYWORD |
| 234 gfx::VectorIconId::OMNIBOX_HTTP, // NAVSUGGEST | 234 gfx::VectorIconId::OMNIBOX_HTTP, // NAVSUGGEST |
| 235 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_WHAT_YOU_TYPED | 235 gfx::VectorIconId::SEARCH, // SEARCH_WHAT_YOU_TYPED |
| 236 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_HISTORY | 236 gfx::VectorIconId::SEARCH, // SEARCH_HISTORY |
| 237 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_SUGGEST | 237 gfx::VectorIconId::SEARCH, // SEARCH_SUGGEST |
| 238 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_SUGGEST_ENTITY | 238 gfx::VectorIconId::SEARCH, // SEARCH_SUGGEST_ENTITY |
| 239 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_SUGGEST_TAIL | 239 gfx::VectorIconId::SEARCH, // SEARCH_SUGGEST_TAIL |
| 240 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED | 240 gfx::VectorIconId::SEARCH, // SEARCH_SUGGEST_PERSONALIZED |
| 241 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE | 241 gfx::VectorIconId::SEARCH, // SEARCH_SUGGEST_PROFILE |
| 242 gfx::VectorIconId::OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE | 242 gfx::VectorIconId::SEARCH, // SEARCH_OTHER_ENGINE |
| 243 gfx::VectorIconId::OMNIBOX_EXTENSION_APP, // EXTENSION_APP | 243 gfx::VectorIconId::OMNIBOX_EXTENSION_APP, // EXTENSION_APP |
| 244 gfx::VectorIconId::OMNIBOX_SEARCH, // CONTACT_DEPRECATED | 244 gfx::VectorIconId::SEARCH, // CONTACT_DEPRECATED |
| 245 gfx::VectorIconId::OMNIBOX_HTTP, // BOOKMARK_TITLE | 245 gfx::VectorIconId::OMNIBOX_HTTP, // BOOKMARK_TITLE |
| 246 gfx::VectorIconId::OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED | 246 gfx::VectorIconId::OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED |
| 247 gfx::VectorIconId::OMNIBOX_CALCULATOR, // CALCULATOR | 247 gfx::VectorIconId::OMNIBOX_CALCULATOR, // CALCULATOR |
| 248 gfx::VectorIconId::OMNIBOX_HTTP, // CLIPBOARD | 248 gfx::VectorIconId::OMNIBOX_HTTP, // CLIPBOARD |
| 249 gfx::VectorIconId::OMNIBOX_SEARCH, // VOICE_SEARCH | 249 gfx::VectorIconId::SEARCH, // VOICE_SEARCH |
| 250 }; | 250 }; |
| 251 static_assert(arraysize(kIcons) == AutocompleteMatchType::NUM_TYPES, | 251 static_assert(arraysize(kIcons) == AutocompleteMatchType::NUM_TYPES, |
| 252 "icons array must have NUM_TYPES elements"); | 252 "icons array must have NUM_TYPES elements"); |
| 253 return kIcons[type]; | 253 return kIcons[type]; |
| 254 #else | 254 #else |
| 255 NOTREACHED(); | 255 NOTREACHED(); |
| 256 return gfx::VectorIconId::VECTOR_ICON_NONE; | 256 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 257 #endif | 257 #endif |
| 258 } | 258 } |
| 259 | 259 |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 657 << " is unsorted in relation to last offset of " << last_offset | 657 << " is unsorted in relation to last offset of " << last_offset |
| 658 << ". Provider: " << provider_name << "."; | 658 << ". Provider: " << provider_name << "."; |
| 659 DCHECK_LT(i->offset, text.length()) | 659 DCHECK_LT(i->offset, text.length()) |
| 660 << " Classification of [" << i->offset << "," << text.length() | 660 << " Classification of [" << i->offset << "," << text.length() |
| 661 << "] is out of bounds for \"" << text << "\". Provider: " | 661 << "] is out of bounds for \"" << text << "\". Provider: " |
| 662 << provider_name << "."; | 662 << provider_name << "."; |
| 663 last_offset = i->offset; | 663 last_offset = i->offset; |
| 664 } | 664 } |
| 665 } | 665 } |
| 666 #endif | 666 #endif |
| OLD | NEW |