Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(84)

Side by Side Diff: components/omnibox/browser/autocomplete_match.cc

Issue 2203993002: Add a Physical Web omnibox autocomplete provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: data source changes Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED 184 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED
185 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE 185 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE
186 IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE 186 IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE
187 IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP 187 IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP
188 IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED 188 IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED
189 IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE 189 IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE
190 IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED 190 IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED
191 IDR_OMNIBOX_CALCULATOR, // CALCULATOR 191 IDR_OMNIBOX_CALCULATOR, // CALCULATOR
192 IDR_OMNIBOX_HTTP, // CLIPBOARD 192 IDR_OMNIBOX_HTTP, // CLIPBOARD
193 IDR_OMNIBOX_SEARCH, // VOICE_SEARCH 193 IDR_OMNIBOX_SEARCH, // VOICE_SEARCH
194 }; 194 };
Mark P 2016/08/08 20:41:37 I think you need to add the icon here too, otherwi
mattreynolds 2016/08/09 21:42:02 Done. Also added to the list in TypeToVectorIcon.
195 #else 195 #else
196 static const int kIcons[] = { 196 static const int kIcons[] = {
197 IDR_OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE 197 IDR_OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE
198 IDR_OMNIBOX_HISTORY, // HISTORY_URL 198 IDR_OMNIBOX_HISTORY, // HISTORY_URL
199 IDR_OMNIBOX_HISTORY, // HISTORY_TITLE 199 IDR_OMNIBOX_HISTORY, // HISTORY_TITLE
200 IDR_OMNIBOX_HISTORY, // HISTORY_BODY 200 IDR_OMNIBOX_HISTORY, // HISTORY_BODY
201 IDR_OMNIBOX_HISTORY, // HISTORY_KEYWORD 201 IDR_OMNIBOX_HISTORY, // HISTORY_KEYWORD
202 IDR_OMNIBOX_HTTP, // NAVSUGGEST 202 IDR_OMNIBOX_HTTP, // NAVSUGGEST
203 IDR_OMNIBOX_SEARCH, // SEARCH_WHAT_YOU_TYPED 203 IDR_OMNIBOX_SEARCH, // SEARCH_WHAT_YOU_TYPED
204 IDR_OMNIBOX_HISTORY, // SEARCH_HISTORY 204 IDR_OMNIBOX_HISTORY, // SEARCH_HISTORY
205 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST 205 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST
206 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_ENTITY 206 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_ENTITY
207 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_TAIL 207 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_TAIL
208 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED 208 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED
209 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE 209 IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE
210 IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE 210 IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE
211 IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP 211 IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP
212 IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED 212 IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED
213 IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE 213 IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE
214 IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED 214 IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED
215 IDR_OMNIBOX_CALCULATOR, // CALCULATOR 215 IDR_OMNIBOX_CALCULATOR, // CALCULATOR
216 IDR_OMNIBOX_HTTP, // CLIPBOARD 216 IDR_OMNIBOX_HTTP, // CLIPBOARD
217 IDR_OMNIBOX_SEARCH, // VOICE_SEARCH 217 IDR_OMNIBOX_SEARCH, // VOICE_SEARCH
218 IDR_OMNIBOX_HTTP, // PHYSICAL_WEB
218 }; 219 };
219 #endif 220 #endif
220 static_assert(arraysize(kIcons) == AutocompleteMatchType::NUM_TYPES, 221 static_assert(arraysize(kIcons) == AutocompleteMatchType::NUM_TYPES,
221 "icons array must have NUM_TYPES elements"); 222 "icons array must have NUM_TYPES elements");
222 return kIcons[type]; 223 return kIcons[type];
223 } 224 }
224 225
225 // static 226 // static
226 gfx::VectorIconId AutocompleteMatch::TypeToVectorIcon(Type type) { 227 gfx::VectorIconId AutocompleteMatch::TypeToVectorIcon(Type type) {
227 #if !defined(OS_ANDROID) && !defined(OS_IOS) 228 #if !defined(OS_ANDROID) && !defined(OS_IOS)
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 << " is unsorted in relation to last offset of " << last_offset 658 << " is unsorted in relation to last offset of " << last_offset
658 << ". Provider: " << provider_name << "."; 659 << ". Provider: " << provider_name << ".";
659 DCHECK_LT(i->offset, text.length()) 660 DCHECK_LT(i->offset, text.length())
660 << " Classification of [" << i->offset << "," << text.length() 661 << " Classification of [" << i->offset << "," << text.length()
661 << "] is out of bounds for \"" << text << "\". Provider: " 662 << "] is out of bounds for \"" << text << "\". Provider: "
662 << provider_name << "."; 663 << provider_name << ".";
663 last_offset = i->offset; 664 last_offset = i->offset;
664 } 665 }
665 } 666 }
666 #endif 667 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698