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 | |
229 void LocationBarViewMac::UpdateLocationBarVisibility(bool visible, | 224 void LocationBarViewMac::UpdateLocationBarVisibility(bool visible, |
230 bool animate) { | 225 bool animate) { |
231 // Track the target location bar visibility to avoid redundant transitions | 226 // Track the target location bar visibility to avoid redundant transitions |
232 // being initiated when one is already in progress. | 227 // being initiated when one is already in progress. |
233 if (visible != location_bar_visible_) { | 228 if (visible != location_bar_visible_) { |
234 [[[BrowserWindowController browserWindowControllerForView:field_] | 229 [[[BrowserWindowController browserWindowControllerForView:field_] |
235 toolbarController] updateVisibility:visible | 230 toolbarController] updateVisibility:visible |
236 withAnimation:animate]; | 231 withAnimation:animate]; |
237 location_bar_visible_ = visible; | 232 location_bar_visible_ = visible; |
238 } | 233 } |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 OnDecorationsChanged(); | 805 OnDecorationsChanged(); |
811 } | 806 } |
812 | 807 |
813 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { | 808 std::vector<NSView*> LocationBarViewMac::GetDecorationAccessibilityViews() { |
814 std::vector<LocationBarDecoration*> decorations = GetDecorations(); | 809 std::vector<LocationBarDecoration*> decorations = GetDecorations(); |
815 std::vector<NSView*> views; | 810 std::vector<NSView*> views; |
816 for (auto* decoration : decorations) | 811 for (auto* decoration : decorations) |
817 views.push_back(decoration->GetAccessibilityView()); | 812 views.push_back(decoration->GetAccessibilityView()); |
818 return views; | 813 return views; |
819 } | 814 } |
OLD | NEW |