OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines helper functions shared by the various implementations | 5 // This file defines helper functions shared by the various implementations |
6 // of OmniboxView. | 6 // of OmniboxView. |
7 | 7 |
8 #include "components/omnibox/browser/omnibox_view.h" | 8 #include "components/omnibox/browser/omnibox_view.h" |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_INVERT; | 95 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID_INVERT; |
96 if (id == gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID) | 96 if (id == gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID) |
97 return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID_INVERT; | 97 return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID_INVERT; |
98 } | 98 } |
99 return id; | 99 return id; |
100 } | 100 } |
101 // Reuse the dropdown icons... | 101 // Reuse the dropdown icons... |
102 gfx::VectorIconId id = AutocompleteMatch::TypeToVectorIcon( | 102 gfx::VectorIconId id = AutocompleteMatch::TypeToVectorIcon( |
103 model_ ? model_->CurrentTextType() | 103 model_ ? model_->CurrentTextType() |
104 : AutocompleteMatchType::URL_WHAT_YOU_TYPED); | 104 : AutocompleteMatchType::URL_WHAT_YOU_TYPED); |
105 // but use a tweaked version for the HTTP icon. | 105 // but use a different version for the HTTP icon. |
106 return (id == gfx::VectorIconId::OMNIBOX_HTTP) | 106 return (id == gfx::VectorIconId::OMNIBOX_HTTP) |
107 ? gfx::VectorIconId::LOCATION_BAR_HTTP | 107 ? gfx::VectorIconId::LOCATION_BAR_HTTP |
108 : id; | 108 : id; |
109 #else | 109 #else |
110 NOTIMPLEMENTED(); | 110 NOTIMPLEMENTED(); |
111 return gfx::VectorIconId::VECTOR_ICON_NONE; | 111 return gfx::VectorIconId::VECTOR_ICON_NONE; |
112 #endif | 112 #endif |
113 } | 113 } |
114 | 114 |
115 void OmniboxView::SetUserText(const base::string16& text) { | 115 void OmniboxView::SetUserText(const base::string16& text) { |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 if (client) { | 182 if (client) { |
183 model_.reset(new OmniboxEditModel(this, controller, std::move(client))); | 183 model_.reset(new OmniboxEditModel(this, controller, std::move(client))); |
184 } | 184 } |
185 } | 185 } |
186 | 186 |
187 void OmniboxView::TextChanged() { | 187 void OmniboxView::TextChanged() { |
188 EmphasizeURLComponents(); | 188 EmphasizeURLComponents(); |
189 if (model_.get()) | 189 if (model_.get()) |
190 model_->OnChanged(); | 190 model_->OnChanged(); |
191 } | 191 } |
OLD | NEW |