OLD | NEW |
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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void SaveCardBubbleControllerImpl::ReshowBubble() { | 203 void SaveCardBubbleControllerImpl::ReshowBubble() { |
204 is_reshow_ = true; | 204 is_reshow_ = true; |
205 AutofillMetrics::LogSaveCardPromptMetric( | 205 AutofillMetrics::LogSaveCardPromptMetric( |
206 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, | 206 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, |
207 is_reshow_); | 207 is_reshow_); |
208 | 208 |
209 ShowBubble(); | 209 ShowBubble(); |
210 } | 210 } |
211 | 211 |
| 212 void SaveCardBubbleControllerImpl::HideBubble() { |
| 213 if (save_card_bubble_view_) { |
| 214 save_card_bubble_view_->Hide(); |
| 215 save_card_bubble_view_ = nullptr; |
| 216 } |
| 217 } |
| 218 |
212 bool SaveCardBubbleControllerImpl::IsIconVisible() const { | 219 bool SaveCardBubbleControllerImpl::IsIconVisible() const { |
213 return !save_card_callback_.is_null(); | 220 return !save_card_callback_.is_null(); |
214 } | 221 } |
215 | 222 |
216 SaveCardBubbleView* SaveCardBubbleControllerImpl::save_card_bubble_view() | 223 SaveCardBubbleView* SaveCardBubbleControllerImpl::save_card_bubble_view() |
217 const { | 224 const { |
218 return save_card_bubble_view_; | 225 return save_card_bubble_view_; |
219 } | 226 } |
220 | 227 |
221 base::string16 SaveCardBubbleControllerImpl::GetWindowTitle() const { | 228 base::string16 SaveCardBubbleControllerImpl::GetWindowTitle() const { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |