Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/location_bar_view.cc |
| diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| index 76c548b99e18f71bdf00f69e84a39fc08fe50e9b..ea1c268d9984ab404430c04d65506da5c74897d2 100644 |
| --- a/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| +++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc |
| @@ -140,11 +140,7 @@ LocationBarView::LocationBarView(Browser* browser, |
| is_popup_mode_(is_popup_mode), |
| show_focus_rect_(false), |
| template_url_service_(NULL), |
| - web_contents_null_at_last_refresh_(true), |
| - should_show_secure_state_(false), |
| - should_show_nonsecure_state_(false), |
| - should_animate_secure_state_(false), |
| - should_animate_nonsecure_state_(false) { |
| + web_contents_null_at_last_refresh_(true) { |
| edit_bookmarks_enabled_.Init( |
| bookmarks::prefs::kEditBookmarksEnabled, profile->GetPrefs(), |
| base::Bind(&LocationBarView::UpdateWithoutTabRestore, |
| @@ -152,38 +148,6 @@ LocationBarView::LocationBarView(Browser* browser, |
| zoom::ZoomEventManager::GetForBrowserContext(profile) |
| ->AddZoomEventManagerObserver(this); |
| - |
| - base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
|
Peter Kasting
2016/12/10 02:36:38
Nit: See if relevant #includes (command_line.h, ch
estark
2016/12/14 17:54:28
Done; removed command_line.h, chrome_switches.h, c
|
| - std::string security_chip_visibility; |
| - if (command_line->HasSwitch(switches::kSecurityChip)) { |
| - security_chip_visibility = |
| - command_line->GetSwitchValueASCII(switches::kSecurityChip); |
| - } else if (base::FeatureList::IsEnabled(features::kSecurityChip)) { |
| - security_chip_visibility = |
| - variations::GetVariationParamValueByFeature( |
| - features::kSecurityChip, kSecurityChipFeatureVisibilityParam); |
| - } |
| - |
| - should_show_secure_state_ = |
| - security_chip_visibility == switches::kSecurityChipShowAll; |
| - should_show_nonsecure_state_ = |
| - should_show_secure_state_ || |
| - security_chip_visibility == switches::kSecurityChipShowNonSecureOnly; |
| - |
| - std::string security_chip_animation; |
| - if (command_line->HasSwitch(switches::kSecurityChipAnimation)) { |
| - security_chip_animation = |
| - command_line->GetSwitchValueASCII(switches::kSecurityChipAnimation); |
| - } else if (base::FeatureList::IsEnabled(features::kSecurityChip)) { |
| - security_chip_animation = variations::GetVariationParamValueByFeature( |
| - features::kSecurityChip, kSecurityChipFeatureAnimationParam); |
| - } |
| - |
| - should_animate_secure_state_ = |
| - security_chip_animation == switches::kSecurityChipAnimationAll; |
| - should_animate_nonsecure_state_ = |
| - should_animate_secure_state_ || |
| - security_chip_animation == switches::kSecurityChipAnimationNonSecureOnly; |
| } |
| LocationBarView::~LocationBarView() { |
| @@ -931,15 +895,9 @@ bool LocationBarView::ShouldShowKeywordBubble() const { |
| bool LocationBarView::ShouldShowSecurityChip() const { |
| using SecurityLevel = security_state::SecurityLevel; |
| const SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false); |
| - if (level == SecurityLevel::EV_SECURE) { |
| - return true; |
| - } else if (level == SecurityLevel::SECURE) { |
| - return should_show_secure_state_; |
| - } else { |
| - return should_show_nonsecure_state_ && |
| - (level == SecurityLevel::DANGEROUS || |
| - level == SecurityLevel::HTTP_SHOW_WARNING); |
| - } |
| + return level == SecurityLevel::EV_SECURE || level == SecurityLevel::SECURE || |
| + level == SecurityLevel::DANGEROUS || |
| + level == SecurityLevel::HTTP_SHOW_WARNING; |
| } |
| bool LocationBarView::ShouldAnimateSecurityChip() const { |
| @@ -947,11 +905,8 @@ bool LocationBarView::ShouldAnimateSecurityChip() const { |
| SecurityLevel level = GetToolbarModel()->GetSecurityLevel(false); |
| if (!ShouldShowSecurityChip()) |
| return false; |
|
Peter Kasting
2016/12/10 02:36:38
Nit: This conditional can disappear entirely.
estark
2016/12/14 17:54:28
Done.
|
| - if (level == SecurityLevel::SECURE || level == SecurityLevel::EV_SECURE) |
| - return should_animate_secure_state_; |
| - return should_animate_nonsecure_state_ && |
| - (level == SecurityLevel::DANGEROUS || |
| - level == SecurityLevel::HTTP_SHOW_WARNING); |
| + return level == SecurityLevel::DANGEROUS || |
| + level == SecurityLevel::HTTP_SHOW_WARNING; |
| } |
| //////////////////////////////////////////////////////////////////////////////// |