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

Unified Diff: components/omnibox/browser/autocomplete_match.cc

Issue 2399333002: Revert of Delete pre-MD code from OmniboxResultView (Closed)
Patch Set: Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/omnibox/browser/autocomplete_match.h ('k') | components/omnibox/browser/omnibox_view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/omnibox/browser/autocomplete_match.cc
diff --git a/components/omnibox/browser/autocomplete_match.cc b/components/omnibox/browser/autocomplete_match.cc
index c8b890d060aa8286c1cff9e6b9c3e75d5f5f7f52..c0913fbaba476bd4d1e2ceb9e49b04e4a271554c 100644
--- a/components/omnibox/browser/autocomplete_match.cc
+++ b/components/omnibox/browser/autocomplete_match.cc
@@ -20,6 +20,7 @@
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "components/url_formatter/url_formatter.h"
+#include "grit/components_scaled_resources.h"
#include "ui/gfx/vector_icons_public.h"
namespace {
@@ -163,6 +164,66 @@
additional_info = match.additional_info;
duplicate_matches = match.duplicate_matches;
return *this;
+}
+
+// static
+int AutocompleteMatch::TypeToIcon(Type type) {
+#if !defined(OS_IOS)
+ static const int kIcons[] = {
+ IDR_OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE
+ IDR_OMNIBOX_HTTP, // HISTORY_URL
+ IDR_OMNIBOX_HTTP, // HISTORY_TITLE
+ IDR_OMNIBOX_HTTP, // HISTORY_BODY
+ IDR_OMNIBOX_HTTP, // HISTORY_KEYWORD
+ IDR_OMNIBOX_HTTP, // NAVSUGGEST
+ IDR_OMNIBOX_SEARCH, // SEARCH_WHAT_YOU_TYPED
+ IDR_OMNIBOX_SEARCH, // SEARCH_HISTORY
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_ENTITY
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_TAIL
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE
+ IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE
+ IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP
+ IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED
+ IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE
+ IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED
+ IDR_OMNIBOX_CALCULATOR, // CALCULATOR
+ IDR_OMNIBOX_HTTP, // CLIPBOARD
+ IDR_OMNIBOX_SEARCH, // VOICE_SEARCH
+ IDR_OMNIBOX_HTTP, // PHYSICAL_WEB
+ IDR_OMNIBOX_HTTP, // PHYSICAL_WEB_OVERFLOW
+ };
+#else
+ static const int kIcons[] = {
+ IDR_OMNIBOX_HTTP, // URL_WHAT_YOU_TYPE
+ IDR_OMNIBOX_HISTORY, // HISTORY_URL
+ IDR_OMNIBOX_HISTORY, // HISTORY_TITLE
+ IDR_OMNIBOX_HISTORY, // HISTORY_BODY
+ IDR_OMNIBOX_HISTORY, // HISTORY_KEYWORD
+ IDR_OMNIBOX_HTTP, // NAVSUGGEST
+ IDR_OMNIBOX_SEARCH, // SEARCH_WHAT_YOU_TYPED
+ IDR_OMNIBOX_HISTORY, // SEARCH_HISTORY
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_ENTITY
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_TAIL
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PERSONALIZED
+ IDR_OMNIBOX_SEARCH, // SEARCH_SUGGEST_PROFILE
+ IDR_OMNIBOX_SEARCH, // SEARCH_OTHER_ENGINE
+ IDR_OMNIBOX_EXTENSION_APP, // EXTENSION_APP
+ IDR_OMNIBOX_SEARCH, // CONTACT_DEPRECATED
+ IDR_OMNIBOX_HTTP, // BOOKMARK_TITLE
+ IDR_OMNIBOX_HTTP, // NAVSUGGEST_PERSONALIZED
+ IDR_OMNIBOX_CALCULATOR, // CALCULATOR
+ IDR_OMNIBOX_HTTP, // CLIPBOARD
+ IDR_OMNIBOX_SEARCH, // VOICE_SEARCH
+ IDR_OMNIBOX_HTTP, // PHYSICAL_WEB
+ IDR_OMNIBOX_HTTP, // PHYSICAL_WEB_OVERFLOW
+ };
+#endif
+ static_assert(arraysize(kIcons) == AutocompleteMatchType::NUM_TYPES,
+ "icons array must have NUM_TYPES elements");
+ return kIcons[type];
}
// static
« no previous file with comments | « components/omnibox/browser/autocomplete_match.h ('k') | components/omnibox/browser/omnibox_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698