| 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 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 if (!web_contents) | 191 if (!web_contents) |
| 192 return; | 192 return; |
| 193 | 193 |
| 194 // |controller| may be nullptr due to lazy initialization. | 194 // |controller| may be nullptr due to lazy initialization. |
| 195 autofill::SaveCardBubbleControllerImpl* controller = | 195 autofill::SaveCardBubbleControllerImpl* controller = |
| 196 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents); | 196 autofill::SaveCardBubbleControllerImpl::FromWebContents(web_contents); |
| 197 bool enabled = controller && controller->IsIconVisible(); | 197 bool enabled = controller && controller->IsIconVisible(); |
| 198 command_updater()->UpdateCommandEnabled(IDC_SAVE_CREDIT_CARD_FOR_PAGE, | 198 command_updater()->UpdateCommandEnabled(IDC_SAVE_CREDIT_CARD_FOR_PAGE, |
| 199 enabled); | 199 enabled); |
| 200 save_credit_card_decoration_->SetVisible(enabled); | 200 save_credit_card_decoration_->SetVisible(enabled); |
| 201 OnDecorationsChanged(); |
| 201 } | 202 } |
| 202 | 203 |
| 203 void LocationBarViewMac::UpdatePageActions() { | 204 void LocationBarViewMac::UpdatePageActions() { |
| 204 RefreshPageActionDecorations(); | 205 RefreshPageActionDecorations(); |
| 205 Layout(); | 206 Layout(); |
| 206 | 207 |
| 207 [field_ updateMouseTracking]; | 208 [field_ updateMouseTracking]; |
| 208 [field_ setNeedsDisplay:YES]; | 209 [field_ setNeedsDisplay:YES]; |
| 209 } | 210 } |
| 210 | 211 |
| (...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 | 717 |
| 717 return zoom_decoration_->UpdateIfNecessary( | 718 return zoom_decoration_->UpdateIfNecessary( |
| 718 ui_zoom::ZoomController::FromWebContents(web_contents), | 719 ui_zoom::ZoomController::FromWebContents(web_contents), |
| 719 default_zoom_changed); | 720 default_zoom_changed); |
| 720 } | 721 } |
| 721 | 722 |
| 722 void LocationBarViewMac::OnDefaultZoomLevelChanged() { | 723 void LocationBarViewMac::OnDefaultZoomLevelChanged() { |
| 723 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) | 724 if (UpdateZoomDecoration(/*default_zoom_changed=*/true)) |
| 724 OnDecorationsChanged(); | 725 OnDecorationsChanged(); |
| 725 } | 726 } |
| OLD | NEW |