| Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| index bf0aa871ac38a3174f92b37070eed965963b51b0..dc3f9a91299f0ac35428c672fd9f5140cd3b8204 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
|
| @@ -458,6 +458,7 @@ void LocationBarViewMac::OnDecorationsChanged() {
|
| // TODO(shess): This function should over time grow to closely match
|
| // the views Layout() function.
|
| void LocationBarViewMac::Layout() {
|
| + LOG(ERROR) << "LBVMac::Layout, security bubble is visible? " << security_state_bubble_decoration_->IsVisible();
|
| AutocompleteTextFieldCell* cell = [field_ cell];
|
|
|
| // Reset the left-hand decorations.
|
| @@ -529,12 +530,14 @@ void LocationBarViewMac::Layout() {
|
| // displayed, even if the width is narrow.
|
| is_width_available_for_security_verbose_ = true;
|
| } else if (ShouldShowSecurityState()) {
|
| + LOG(ERROR) << "LBVMac::Layout, ShouldShowSecurityState true";
|
| CGFloat available_width =
|
| [cell availableWidthInFrame:[[cell controlView] frame]];
|
| is_width_available_for_security_verbose_ = available_width >= kMinURLWidth;
|
| bool is_security_state_visible =
|
| is_width_available_for_security_verbose_ ||
|
| security_state_bubble_decoration_->AnimatingOut();
|
| + LOG(ERROR) << "LBVMac::Layout, setting security bubble visibility to " << is_security_state_visible;
|
| location_icon_decoration_->SetVisible(!is_security_state_visible);
|
| security_state_bubble_decoration_->SetVisible(is_security_state_visible);
|
|
|
| @@ -617,6 +620,7 @@ void LocationBarViewMac::ResetTabState(WebContents* contents) {
|
| }
|
|
|
| void LocationBarViewMac::Update(const WebContents* contents) {
|
| + LOG(ERROR) << "LBVMac::Update " << contents;
|
| UpdateManagePasswordsIconAndBubble();
|
| UpdateBookmarkStarVisibility();
|
| UpdateSaveCreditCardIcon();
|
| @@ -652,6 +656,8 @@ void LocationBarViewMac::UpdateLocationIcon() {
|
| security_state_bubble_decoration_->SetImage(image);
|
| security_state_bubble_decoration_->SetLabelColor(vector_icon_color);
|
|
|
| + LOG(ERROR) << "LBVMac::UpdateLocationIcon, security bubble is visible? " << security_state_bubble_decoration_->IsVisible();
|
| +
|
| Layout();
|
| }
|
|
|
| @@ -700,6 +706,7 @@ bool LocationBarViewMac::ShouldShowEVBubble() const {
|
| }
|
|
|
| bool LocationBarViewMac::ShouldShowSecurityState() const {
|
| + LOG(ERROR) << "LBVMac::ShouldShowSecurityState";
|
| if (omnibox_view_->IsEditingOrEmpty() ||
|
| omnibox_view_->model()->is_keyword_hint()) {
|
| return false;
|
| @@ -707,6 +714,7 @@ bool LocationBarViewMac::ShouldShowSecurityState() const {
|
|
|
| security_state::SecurityStateModel::SecurityLevel security =
|
| GetToolbarModel()->GetSecurityLevel(false);
|
| + LOG(ERROR) << "LBVMac::ShouldShowSecurityState security level " << security << ", " << should_show_nonsecure_verbose_ << ", " << should_show_secure_verbose_;
|
|
|
| if (security == security_state::SecurityStateModel::EV_SECURE)
|
| return true;
|
| @@ -897,8 +905,10 @@ bool LocationBarViewMac::UpdateZoomDecoration(bool default_zoom_changed) {
|
| }
|
|
|
| void LocationBarViewMac::UpdateSecurityState(bool tab_changed) {
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState " << tab_changed;
|
| if (!ShouldShowSecurityState())
|
| return;
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState should show. Old security level " << security_level_;
|
|
|
| security_state::SecurityStateModel::SecurityLevel new_security_level =
|
| GetToolbarModel()->GetSecurityLevel(false);
|
| @@ -909,15 +919,21 @@ void LocationBarViewMac::UpdateSecurityState(bool tab_changed) {
|
| security_level_ != new_security_level && !is_secure_to_secure;
|
| security_level_ = new_security_level;
|
|
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState new security level " << new_security_level << ", " << is_secure_to_secure << ", " << is_new_security_level;
|
| +
|
| // If there's enough space, but the secure state decoration had animated
|
| // out, animate it back in. Otherwise, if the security state has changed,
|
| // animate the decoration if animation is enabled and the state changed is
|
| // not from a tab switch.
|
| if (is_width_available_for_security_verbose_) {
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState is width available yes";
|
| bool is_animated =
|
| (is_new_level_secure && should_animate_secure_verbose_) ||
|
| (!is_new_level_secure && should_animate_nonsecure_verbose_);
|
|
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState tab changed " << tab_changed;
|
| + LOG(ERROR) << "LBVMac::UpdateSecurityState has animated out " << security_state_bubble_decoration_->HasAnimatedOut();
|
| +
|
| if (!tab_changed && security_state_bubble_decoration_->HasAnimatedOut())
|
| security_state_bubble_decoration_->AnimateIn(false);
|
| else if (tab_changed || !is_animated)
|
|
|