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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel( | 62 security_state::SecurityLevel ToolbarModelImpl::GetSecurityLevel( |
63 bool ignore_editing) const { | 63 bool ignore_editing) const { |
64 // When editing or empty, assume no security style. | 64 // When editing or empty, assume no security style. |
65 return ((input_in_progress() && !ignore_editing) || !ShouldDisplayURL()) | 65 return ((input_in_progress() && !ignore_editing) || !ShouldDisplayURL()) |
66 ? security_state::NONE | 66 ? security_state::NONE |
67 : delegate_->GetSecurityLevel(); | 67 : delegate_->GetSecurityLevel(); |
68 } | 68 } |
69 | 69 |
70 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { | 70 gfx::VectorIconId ToolbarModelImpl::GetVectorIcon() const { |
71 #if !defined(OS_ANDROID) && !defined(OS_IOS) | 71 #if !defined(OS_ANDROID) && !defined(OS_IOS) |
72 if (GetURL().SchemeIs("chrome-extension")) { | |
Peter Kasting
2016/12/14 22:47:07
Nit: No {}
meacer
2016/12/16 18:46:18
Done.
| |
73 return gfx::VectorIconId::EXTENSION; | |
74 } | |
72 switch (GetSecurityLevel(false)) { | 75 switch (GetSecurityLevel(false)) { |
73 case security_state::NONE: | 76 case security_state::NONE: |
74 case security_state::HTTP_SHOW_WARNING: | 77 case security_state::HTTP_SHOW_WARNING: |
75 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 78 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
76 case security_state::EV_SECURE: | 79 case security_state::EV_SECURE: |
77 case security_state::SECURE: | 80 case security_state::SECURE: |
78 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; | 81 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; |
79 case security_state::SECURITY_WARNING: | 82 case security_state::SECURITY_WARNING: |
80 // Surface Dubious as Neutral. | 83 // Surface Dubious as Neutral. |
81 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 84 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 ? IDS_DANGEROUS_VERBOSE_STATE | 120 ? IDS_DANGEROUS_VERBOSE_STATE |
118 : IDS_NOT_SECURE_VERBOSE_STATE); | 121 : IDS_NOT_SECURE_VERBOSE_STATE); |
119 default: | 122 default: |
120 return base::string16(); | 123 return base::string16(); |
121 } | 124 } |
122 } | 125 } |
123 | 126 |
124 bool ToolbarModelImpl::ShouldDisplayURL() const { | 127 bool ToolbarModelImpl::ShouldDisplayURL() const { |
125 return delegate_->ShouldDisplayURL(); | 128 return delegate_->ShouldDisplayURL(); |
126 } | 129 } |
OLD | NEW |