| 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel( | 66 security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel( |
| 67 bool ignore_editing) const { | 67 bool ignore_editing) const { |
| 68 // When editing or empty, assume no security style. | 68 // When editing or empty, assume no security style. |
| 69 return ((input_in_progress() && !ignore_editing) || !ShouldDisplayURL()) | 69 return ((input_in_progress() && !ignore_editing) || !ShouldDisplayURL()) |
| 70 ? security_state::NONE | 70 ? security_state::NONE |
| 71 : delegate_->GetSecurityLevel(); | 71 : delegate_->GetSecurityLevel(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 const gfx::VectorIcon& ToolbarModelImpl::GetVectorIcon() const { | 74 const gfx::VectorIcon& ToolbarModelImpl::GetVectorIcon() const { |
| 75 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 75 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 76 const auto icon_override = delegate_->GetVectorIconOverride(); | 76 auto* const icon_override = delegate_->GetVectorIconOverride(); |
| 77 if (icon_override) | 77 if (icon_override) |
| 78 return *icon_override; | 78 return *icon_override; |
| 79 | 79 |
| 80 switch (GetSecurityLevel(false)) { | 80 switch (GetSecurityLevel(false)) { |
| 81 case security_state::NONE: | 81 case security_state::NONE: |
| 82 case security_state::HTTP_SHOW_WARNING: | 82 case security_state::HTTP_SHOW_WARNING: |
| 83 return toolbar::kHttpIcon; | 83 return toolbar::kHttpIcon; |
| 84 case security_state::EV_SECURE: | 84 case security_state::EV_SECURE: |
| 85 case security_state::SECURE: | 85 case security_state::SECURE: |
| 86 return toolbar::kHttpsValidIcon; | 86 return toolbar::kHttpsValidIcon; |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 ? IDS_DANGEROUS_VERBOSE_STATE | 129 ? IDS_DANGEROUS_VERBOSE_STATE |
| 130 : IDS_NOT_SECURE_VERBOSE_STATE); | 130 : IDS_NOT_SECURE_VERBOSE_STATE); |
| 131 default: | 131 default: |
| 132 return base::string16(); | 132 return base::string16(); |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool ToolbarModelImpl::ShouldDisplayURL() const { | 136 bool ToolbarModelImpl::ShouldDisplayURL() const { |
| 137 return delegate_->ShouldDisplayURL(); | 137 return delegate_->ShouldDisplayURL(); |
| 138 } | 138 } |
| OLD | NEW |