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

Side by Side Diff: chrome/browser/ui/autofill/generated_credit_card_bubble_controller.cc

Issue 22911004: Fix leak in generated credit card bubble tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" 5 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
6 6
7 #include <climits> 7 #include <climits>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 end_link.is_link = true; 216 end_link.is_link = true;
217 contents_text_ranges_.push_back(end_link); 217 contents_text_ranges_.push_back(end_link);
218 218
219 UpdateAnchor(); 219 UpdateAnchor();
220 220
221 if (ShouldDisplayBubbleInitially()) 221 if (ShouldDisplayBubbleInitially())
222 Show(false); 222 Show(false);
223 } 223 }
224 224
225 void GeneratedCreditCardBubbleController::Show(bool was_anchor_click) { 225 void GeneratedCreditCardBubbleController::Show(bool was_anchor_click) {
226 Hide();
227
226 if (!CanShow()) 228 if (!CanShow())
227 return; 229 return;
228 230
229 bubble_ = CreateBubble(); 231 bubble_ = CreateBubble();
230 if (!bubble_) { 232 if (!bubble_) {
231 // TODO(dbeam): Make a bubble on all applicable platforms. 233 // TODO(dbeam): Make a bubble on all applicable platforms.
232 return; 234 return;
233 } 235 }
234 236
235 bubble_->Show(); 237 bubble_->Show();
(...skipping 13 matching lines...) Expand all
249 if (browser && browser->window() && browser->window()->GetLocationBar()) 251 if (browser && browser->window() && browser->window()->GetLocationBar())
250 browser->window()->GetLocationBar()->UpdateGeneratedCreditCardView(); 252 browser->window()->GetLocationBar()->UpdateGeneratedCreditCardView();
251 } 253 }
252 254
253 void GeneratedCreditCardBubbleController::Hide() { 255 void GeneratedCreditCardBubbleController::Hide() {
254 if (bubble_ && !bubble_->IsHiding()) 256 if (bubble_ && !bubble_->IsHiding())
255 bubble_->Hide(); 257 bubble_->Hide();
256 } 258 }
257 259
258 } // namespace autofill 260 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | tools/heapcheck/suppressions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698