Chromium Code Reviews| 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() |
|
Peter Kasting
2015/10/21 19:45:47
Nit: .get() unneeded
Evan Stade
2015/10/21 23:20:01
Done.
|
| + : AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
| + return (id == gfx::VectorIconId::OMNIBOX_HTTP) |
| + ? gfx::VectorIconId::LOCATION_BAR_HTTP |
| + : id; |
|
Peter Kasting
2015/10/21 19:45:47
Honestly I'm not actually clear on what this last
Evan Stade
2015/10/21 23:20:01
done
|
| +#else |
| + NOTIMPLEMENTED(); |
| + return gfx::VectorIconId::VECTOR_ICON_NONE; |
| +#endif |
| +} |
| + |
| void OmniboxView::SetUserText(const base::string16& text) { |
| SetUserText(text, text, true); |
| } |