| 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 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 enabled); | 214 enabled); |
| 215 save_credit_card_decoration_->SetIcon(IsLocationBarDark()); | 215 save_credit_card_decoration_->SetIcon(IsLocationBarDark()); |
| 216 save_credit_card_decoration_->SetVisible(enabled); | 216 save_credit_card_decoration_->SetVisible(enabled); |
| 217 OnDecorationsChanged(); | 217 OnDecorationsChanged(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void LocationBarViewMac::UpdateBookmarkStarVisibility() { | 220 void LocationBarViewMac::UpdateBookmarkStarVisibility() { |
| 221 star_decoration_->SetVisible(IsStarEnabled()); | 221 star_decoration_->SetVisible(IsStarEnabled()); |
| 222 } | 222 } |
| 223 | 223 |
| 224 void LocationBarViewMac::UpdateZoomViewVisibility() { |
| 225 UpdateZoomDecoration(/*default_zoom_changed=*/false); |
| 226 OnChanged(); |
| 227 } |
| 228 |
| 224 void LocationBarViewMac::UpdateLocationBarVisibility(bool visible, | 229 void LocationBarViewMac::UpdateLocationBarVisibility(bool visible, |
| 225 bool animate) { | 230 bool animate) { |
| 226 // Track the target location bar visibility to avoid redundant transitions | 231 // Track the target location bar visibility to avoid redundant transitions |
| 227 // being initiated when one is already in progress. | 232 // being initiated when one is already in progress. |
| 228 if (visible != location_bar_visible_) { | 233 if (visible != location_bar_visible_) { |
| 229 [[[BrowserWindowController browserWindowControllerForView:field_] | 234 [[[BrowserWindowController browserWindowControllerForView:field_] |
| 230 toolbarController] updateVisibility:visible | 235 toolbarController] updateVisibility:visible |
| 231 withAnimation:animate]; | 236 withAnimation:animate]; |
| 232 location_bar_visible_ = visible; | 237 location_bar_visible_ = visible; |
| 233 } | 238 } |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 799 OnDecorationsChanged(); | 804 OnDecorationsChanged(); |
| 800 } | 805 } |
| 801 | 806 |
| 802 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { | 807 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { |
| 803 std::vector<LocationBarDecoration*> decorations = GetDecorations(); | 808 std::vector<LocationBarDecoration*> decorations = GetDecorations(); |
| 804 std::vector<NSView*> views; | 809 std::vector<NSView*> views; |
| 805 for (auto* decoration : decorations) | 810 for (auto* decoration : decorations) |
| 806 views.push_back(decoration->GetAccessibilityView()); | 811 views.push_back(decoration->GetAccessibilityView()); |
| 807 return views; | 812 return views; |
| 808 } | 813 } |
| OLD | NEW |