Chromium Code Reviews| 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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 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 |