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

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

Issue 1410293003: Vectorize LocationIconView icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: self review Created 5 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
Index: components/omnibox/browser/omnibox_view.cc
diff --git a/components/omnibox/browser/omnibox_view.cc b/components/omnibox/browser/omnibox_view.cc
index 7f07d5ae5a8db56c998889429b28aff11e845192..bb2b382879cf4f32bfd5340e7d689bf5e78e9bc8 100644
--- a/components/omnibox/browser/omnibox_view.cc
+++ b/components/omnibox/browser/omnibox_view.cc
@@ -16,6 +16,7 @@
#include "components/toolbar/toolbar_model.h"
#include "grit/components_scaled_resources.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/gfx/vector_icons_public.h"
// static
base::string16 OmniboxView::StripJavascriptSchemas(const base::string16& text) {
@@ -80,6 +81,22 @@ int OmniboxView::GetIcon() const {
return (id == IDR_OMNIBOX_HTTP) ? IDR_LOCATION_BAR_HTTP : id;
}
+gfx::VectorIconId OmniboxView::GetVectorIcon() const {
+#if !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS)
+ if (!IsEditingOrEmpty())
+ return controller_->GetToolbarModel()->GetVectorIcon();
+ gfx::VectorIconId id = AutocompleteMatch::TypeToVectorIcon(
+ model_.get() ? model_->CurrentTextType()
+ : AutocompleteMatchType::URL_WHAT_YOU_TYPED);
+ return (id == gfx::VectorIconId::OMNIBOX_HTTP)
+ ? gfx::VectorIconId::LOCATION_BAR_HTTP
+ : id;
+#else
+ NOTIMPLEMENTED();
+ return gfx::VectorIconId::VECTOR_ICON_NONE;
+#endif
+}
+
void OmniboxView::SetUserText(const base::string16& text) {
SetUserText(text, text, true);
}

Powered by Google App Engine
This is Rietveld 408576698