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

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

Issue 1568983002: Close the save card bubble on tab switch. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove HideBubble from SaveCardBubbleController Created 4 years, 11 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
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 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h" 5 #include "chrome/browser/ui/autofill/save_card_bubble_controller_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/i18n/message_formatter.h" 9 #include "base/i18n/message_formatter.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 is_uploading_, is_reshow_); 193 is_uploading_, is_reshow_);
194 194
195 legal_message_lines_.clear(); 195 legal_message_lines_.clear();
196 return; 196 return;
197 } 197 }
198 198
199 save_card_callback_ = save_card_callback; 199 save_card_callback_ = save_card_callback;
200 ShowBubble(); 200 ShowBubble();
201 } 201 }
202 202
203 void SaveCardBubbleControllerImpl::HideBubble() {
204 if (save_card_bubble_view_) {
205 save_card_bubble_view_->Hide();
206 save_card_bubble_view_ = nullptr;
Evan Stade 2016/01/12 01:24:37 do we not get onbubbleclosed?
Justin Donnelly 2016/01/12 04:24:37 No. Calling Hide() here nulls out the view's refer
207 }
208 }
209
203 void SaveCardBubbleControllerImpl::ReshowBubble() { 210 void SaveCardBubbleControllerImpl::ReshowBubble() {
204 is_reshow_ = true; 211 is_reshow_ = true;
205 AutofillMetrics::LogSaveCardPromptMetric( 212 AutofillMetrics::LogSaveCardPromptMetric(
206 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, 213 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_,
207 is_reshow_); 214 is_reshow_);
208 215
209 ShowBubble(); 216 ShowBubble();
210 } 217 }
211 218
212 bool SaveCardBubbleControllerImpl::IsIconVisible() const { 219 bool SaveCardBubbleControllerImpl::IsIconVisible() const {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 location_bar->UpdateSaveCreditCardIcon(); 342 location_bar->UpdateSaveCreditCardIcon();
336 } 343 }
337 344
338 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { 345 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) {
339 web_contents()->OpenURL( 346 web_contents()->OpenURL(
340 content::OpenURLParams(url, content::Referrer(), NEW_FOREGROUND_TAB, 347 content::OpenURLParams(url, content::Referrer(), NEW_FOREGROUND_TAB,
341 ui::PAGE_TRANSITION_LINK, false)); 348 ui::PAGE_TRANSITION_LINK, false));
342 } 349 }
343 350
344 } // namespace autofill 351 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/save_card_bubble_controller_impl.h ('k') | chrome/browser/ui/views/autofill/save_card_icon_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698