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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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")) | 72 if (GetURL().SchemeIs("chrome-extension")) |
73 return gfx::VectorIconId::EXTENSION; | 73 return gfx::VectorIconId::OMNIBOX_EXTENSION_APP; |
74 | 74 |
75 switch (GetSecurityLevel(false)) { | 75 switch (GetSecurityLevel(false)) { |
76 case security_state::NONE: | 76 case security_state::NONE: |
77 case security_state::HTTP_SHOW_WARNING: | 77 case security_state::HTTP_SHOW_WARNING: |
78 return gfx::VectorIconId::LOCATION_BAR_HTTP; | 78 return gfx::VectorIconId::LOCATION_BAR_HTTP; |
79 case security_state::EV_SECURE: | 79 case security_state::EV_SECURE: |
80 case security_state::SECURE: | 80 case security_state::SECURE: |
81 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; | 81 return gfx::VectorIconId::LOCATION_BAR_HTTPS_VALID; |
82 case security_state::SECURITY_WARNING: | 82 case security_state::SECURITY_WARNING: |
83 // Surface Dubious as Neutral. | 83 // Surface Dubious as Neutral. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ? IDS_DANGEROUS_VERBOSE_STATE | 120 ? IDS_DANGEROUS_VERBOSE_STATE |
121 : IDS_NOT_SECURE_VERBOSE_STATE); | 121 : IDS_NOT_SECURE_VERBOSE_STATE); |
122 default: | 122 default: |
123 return base::string16(); | 123 return base::string16(); |
124 } | 124 } |
125 } | 125 } |
126 | 126 |
127 bool ToolbarModelImpl::ShouldDisplayURL() const { | 127 bool ToolbarModelImpl::ShouldDisplayURL() const { |
128 return delegate_->ShouldDisplayURL(); | 128 return delegate_->ShouldDisplayURL(); |
129 } | 129 } |
OLD | NEW |