Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(168)

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 1783693003: Call OnDecorationsChanged when the save card icon is updated. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698