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

Side by Side Diff: chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.mm

Issue 2227743003: Fix crash bug in save card bubble on Mac. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/autofill/save_card_bubble_view_bridge.h" 5 #import "chrome/browser/ui/cocoa/autofill/save_card_bubble_view_bridge.h"
6 6
7 #include "base/strings/sys_string_conversions.h" 7 #include "base/strings/sys_string_conversions.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/ui/autofill/save_card_bubble_controller.h" 9 #include "chrome/browser/ui/autofill/save_card_bubble_controller.h"
10 #include "chrome/browser/ui/chrome_style.h" 10 #include "chrome/browser/ui/chrome_style.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 controller_->OnLegalMessageLinkClicked(url); 91 controller_->OnLegalMessageLinkClicked(url);
92 } 92 }
93 93
94 void SaveCardBubbleViewBridge::OnBubbleClosed() { 94 void SaveCardBubbleViewBridge::OnBubbleClosed() {
95 if (controller_) 95 if (controller_)
96 controller_->OnBubbleClosed(); 96 controller_->OnBubbleClosed();
97 97
98 delete this; 98 delete this;
99 } 99 }
100 100
101 void SaveCardBubbleViewBridge::Hide() { 101 void SaveCardBubbleViewBridge::Hide() {
groby-ooo-7-16 2016/08/10 19:49:35 That means Hide() can be called several times? How
Justin Donnelly 2016/08/11 15:41:15 Well, to be honest, I can't say that I 100% unders
102 // SaveCardBubbleViewBridge::OnBubbleClosed won't be able to call 102 if (controller_) {
103 // OnBubbleClosed on the bubble controller since we null the reference to it 103 // SaveCardBubbleViewBridge::OnBubbleClosed won't be able to call
104 // below. So we need to call it here. 104 // OnBubbleClosed on the bubble controller since we null the reference to it
105 controller_->OnBubbleClosed(); 105 // below. So we need to call it here.
106 controller_ = nullptr; 106 controller_->OnBubbleClosed();
107 controller_ = nullptr;
108 }
107 [view_controller_ close]; 109 [view_controller_ close];
108 } 110 }
109 111
110 } // autofill 112 } // autofill
111 113
112 #pragma mark SaveCardBubbleViewCocoa 114 #pragma mark SaveCardBubbleViewCocoa
113 115
114 @interface SaveCardBubbleViewCocoa () 116 @interface SaveCardBubbleViewCocoa ()
115 + (base::scoped_nsobject<NSTextField>)makeLabel:(NSString*)text; 117 + (base::scoped_nsobject<NSTextField>)makeLabel:(NSString*)text;
116 + (base::scoped_nsobject<NSTextView>)makeWrappingLabel:(NSString*)text 118 + (base::scoped_nsobject<NSTextView>)makeWrappingLabel:(NSString*)text
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 } 428 }
427 } 429 }
428 430
429 // If none of the legal message links are the source of the click, the source 431 // If none of the legal message links are the source of the click, the source
430 // must be the learn more link. 432 // must be the learn more link.
431 bridge_->OnLearnMoreClicked(); 433 bridge_->OnLearnMoreClicked();
432 return YES; 434 return YES;
433 } 435 }
434 436
435 @end 437 @end
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