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

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: fix android Created 5 years, 1 month 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/omnibox_view.h ('k') | components/toolbar/OWNERS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..9a10d6b0e7105d5617c4571c6a23895e278453fd 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,24 @@ 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();
+ // Reuse the dropdown icons...
+ gfx::VectorIconId id = AutocompleteMatch::TypeToVectorIcon(
+ model_ ? model_->CurrentTextType()
+ : AutocompleteMatchType::URL_WHAT_YOU_TYPED);
+ // but use a tweaked version for the HTTP icon.
+ 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);
}
« no previous file with comments | « components/omnibox/browser/omnibox_view.h ('k') | components/toolbar/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698