OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "components/toolbar/toolbar_model_impl.h" | 5 #include "components/toolbar/toolbar_model_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 return IDR_OMNIBOX_HTTPS_POLICY_WARNING; | 121 return IDR_OMNIBOX_HTTPS_POLICY_WARNING; |
122 case SecurityStateModel::SECURITY_ERROR: | 122 case SecurityStateModel::SECURITY_ERROR: |
123 return IDR_OMNIBOX_HTTPS_INVALID; | 123 return IDR_OMNIBOX_HTTPS_INVALID; |
124 } | 124 } |
125 | 125 |
126 NOTREACHED(); | 126 NOTREACHED(); |
127 return IDR_LOCATION_BAR_HTTP; | 127 return IDR_LOCATION_BAR_HTTP; |
128 } | 128 } |
129 | 129 |
130 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { | 130 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { |
131 #if !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS) | 131 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
132 switch (GetSecurityLevel(false)) { | 132 switch (GetSecurityLevel(false)) { |
133 case SecurityStateModel::NONE: | 133 case SecurityStateModel::NONE: |
134 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 134 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
135 case SecurityStateModel::EV_SECURE: | 135 case SecurityStateModel::EV_SECURE: |
136 case SecurityStateModel::SECURE: | 136 case SecurityStateModel::SECURE: |
137 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; | 137 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; |
138 case SecurityStateModel::SECURITY_WARNING: | 138 case SecurityStateModel::SECURITY_WARNING: |
139 // Surface Dubious as Neutral. | 139 // Surface Dubious as Neutral. |
140 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 140 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
141 case SecurityStateModel::SECURITY_POLICY_WARNING: | 141 case SecurityStateModel::SECURITY_POLICY_WARNING: |
(...skipping 27 matching lines...) Expand all Loading... |
169 bool ToolbarModelImpl::ShouldDisplayURL() const { | 169 bool ToolbarModelImpl::ShouldDisplayURL() const { |
170 return delegate_->ShouldDisplayURL(); | 170 return delegate_->ShouldDisplayURL(); |
171 } | 171 } |
172 | 172 |
173 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { | 173 base::string16 ToolbarModelImpl::GetSearchTerms(bool ignore_editing) const { |
174 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing)) | 174 if (!url_replacement_enabled() || (input_in_progress() && !ignore_editing)) |
175 return base::string16(); | 175 return base::string16(); |
176 | 176 |
177 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing)); | 177 return delegate_->GetSearchTerms(GetSecurityLevel(ignore_editing)); |
178 } | 178 } |
OLD | NEW |