| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 867 return extension_name; | 867 return extension_name; |
| 868 | 868 |
| 869 bool has_ev_cert = | 869 bool has_ev_cert = |
| 870 (GetToolbarModel()->GetSecurityLevel(false) == security_state::EV_SECURE); | 870 (GetToolbarModel()->GetSecurityLevel(false) == security_state::EV_SECURE); |
| 871 return has_ev_cert ? GetToolbarModel()->GetEVCertName() | 871 return has_ev_cert ? GetToolbarModel()->GetEVCertName() |
| 872 : GetToolbarModel()->GetSecureVerboseText(); | 872 : GetToolbarModel()->GetSecureVerboseText(); |
| 873 } | 873 } |
| 874 | 874 |
| 875 bool LocationBarView::ShouldShowKeywordBubble() const { | 875 bool LocationBarView::ShouldShowKeywordBubble() const { |
| 876 return !omnibox_view_->model()->keyword().empty() && | 876 return !omnibox_view_->model()->keyword().empty() && |
| 877 !omnibox_view_->model()->is_keyword_hint(); | 877 !omnibox_view_->model()->is_keyword_hint(); |
| 878 } | 878 } |
| 879 | 879 |
| 880 bool LocationBarView::ShouldShowLocationIconText() const { | 880 bool LocationBarView::ShouldShowLocationIconText() const { |
| 881 if (!GetOmniboxView()->IsEditingOrEmpty() && | 881 if (!GetToolbarModel()->input_in_progress() && |
| 882 (GetToolbarModel()->GetURL().SchemeIs(content::kChromeUIScheme) || | 882 (GetToolbarModel()->GetURL().SchemeIs(content::kChromeUIScheme) || |
| 883 GetToolbarModel()->GetURL().SchemeIs(extensions::kExtensionScheme))) | 883 GetToolbarModel()->GetURL().SchemeIs(extensions::kExtensionScheme))) |
| 884 return true; | 884 return true; |
| 885 | 885 |
| 886 using SecurityLevel = security_state::SecurityLevel; | 886 using SecurityLevel = security_state::SecurityLevel; |
| 887 const SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false); | 887 const SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false); |
| 888 return level == SecurityLevel::EV_SECURE || level == SecurityLevel::SECURE || | 888 return level == SecurityLevel::EV_SECURE || level == SecurityLevel::SECURE || |
| 889 level == SecurityLevel::DANGEROUS || | 889 level == SecurityLevel::DANGEROUS || |
| 890 level == SecurityLevel::HTTP_SHOW_WARNING; | 890 level == SecurityLevel::HTTP_SHOW_WARNING; |
| 891 } | 891 } |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1195 // LocationBarView, private TemplateURLServiceObserver implementation: | 1195 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1196 | 1196 |
| 1197 void LocationBarView::OnTemplateURLServiceChanged() { | 1197 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1198 template_url_service_->RemoveObserver(this); | 1198 template_url_service_->RemoveObserver(this); |
| 1199 template_url_service_ = nullptr; | 1199 template_url_service_ = nullptr; |
| 1200 // If the browser is no longer active, let's not show the info bubble, as this | 1200 // If the browser is no longer active, let's not show the info bubble, as this |
| 1201 // would make the browser the active window again. | 1201 // would make the browser the active window again. |
| 1202 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1202 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1203 ShowFirstRunBubble(); | 1203 ShowFirstRunBubble(); |
| 1204 } | 1204 } |
| OLD | NEW |