| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 : delegate_->GetSecurityLevel(); | 70 : delegate_->GetSecurityLevel(); |
| 71 } | 71 } |
| 72 | 72 |
| 73 int ToolbarModelImpl::GetIcon() const { | 73 int ToolbarModelImpl::GetIcon() const { |
| 74 switch (GetSecurityLevel(false)) { | 74 switch (GetSecurityLevel(false)) { |
| 75 case SecurityStateModel::NONE: | 75 case SecurityStateModel::NONE: |
| 76 return IDR_LOCATION_BAR_HTTP; | 76 return IDR_LOCATION_BAR_HTTP; |
| 77 case SecurityStateModel::EV_SECURE: | 77 case SecurityStateModel::EV_SECURE: |
| 78 case SecurityStateModel::SECURE: | 78 case SecurityStateModel::SECURE: |
| 79 return IDR_OMNIBOX_HTTPS_VALID; | 79 return IDR_OMNIBOX_HTTPS_VALID; |
| 80 case SecurityStateModel::SECURITY_WARNING: | |
| 81 // Surface Dubious as Neutral. | |
| 82 return IDR_LOCATION_BAR_HTTP; | |
| 83 case SecurityStateModel::SECURITY_POLICY_WARNING: | 80 case SecurityStateModel::SECURITY_POLICY_WARNING: |
| 84 return IDR_OMNIBOX_HTTPS_POLICY_WARNING; | 81 return IDR_OMNIBOX_HTTPS_POLICY_WARNING; |
| 85 case SecurityStateModel::SECURITY_ERROR: | 82 case SecurityStateModel::SECURITY_ERROR: |
| 86 return IDR_OMNIBOX_HTTPS_INVALID; | 83 return IDR_OMNIBOX_HTTPS_INVALID; |
| 87 } | 84 } |
| 88 | 85 |
| 89 NOTREACHED(); | 86 NOTREACHED(); |
| 90 return IDR_LOCATION_BAR_HTTP; | 87 return IDR_LOCATION_BAR_HTTP; |
| 91 } | 88 } |
| 92 | 89 |
| 93 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { | 90 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { |
| 94 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 91 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
| 95 switch (GetSecurityLevel(false)) { | 92 switch (GetSecurityLevel(false)) { |
| 96 case SecurityStateModel::NONE: | 93 case SecurityStateModel::NONE: |
| 97 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 94 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
| 98 case SecurityStateModel::EV_SECURE: | 95 case SecurityStateModel::EV_SECURE: |
| 99 case SecurityStateModel::SECURE: | 96 case SecurityStateModel::SECURE: |
| 100 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; | 97 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; |
| 101 case SecurityStateModel::SECURITY_WARNING: | |
| 102 // Surface Dubious as Neutral. | |
| 103 return gfx::VectorIconId::LOCATION_BAR_HTTP; | |
| 104 case SecurityStateModel::SECURITY_POLICY_WARNING: | 98 case SecurityStateModel::SECURITY_POLICY_WARNING: |
| 105 return gfx::VectorIconId::BUSINESS; | 99 return gfx::VectorIconId::BUSINESS; |
| 106 case SecurityStateModel::SECURITY_ERROR: | 100 case SecurityStateModel::SECURITY_ERROR: |
| 107 return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID; | 101 return gfx::VectorIconId::LOCATION_BAR_HTTPS_INVALID; |
| 108 } | 102 } |
| 109 #endif | 103 #endif |
| 110 | 104 |
| 111 NOTREACHED(); | 105 NOTREACHED(); |
| 112 return gfx::VectorIconId::VECTOR_ICON_NONE; | 106 return gfx::VectorIconId::VECTOR_ICON_NONE; |
| 113 } | 107 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 136 case SecurityStateModel::SECURITY_ERROR: | 130 case SecurityStateModel::SECURITY_ERROR: |
| 137 return l10n_util::GetStringUTF16(IDS_NOT_SECURE_VERBOSE_STATE); | 131 return l10n_util::GetStringUTF16(IDS_NOT_SECURE_VERBOSE_STATE); |
| 138 default: | 132 default: |
| 139 return base::string16(); | 133 return base::string16(); |
| 140 } | 134 } |
| 141 } | 135 } |
| 142 | 136 |
| 143 bool ToolbarModelImpl::ShouldDisplayURL() const { | 137 bool ToolbarModelImpl::ShouldDisplayURL() const { |
| 144 return delegate_->ShouldDisplayURL(); | 138 return delegate_->ShouldDisplayURL(); |
| 145 } | 139 } |
| OLD | NEW |