| 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 "chrome/browser/ui/autofill/save_card_bubble_view.h" | 9 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, | 51 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, |
| 52 is_reshow_); | 52 is_reshow_); |
| 53 | 53 |
| 54 card_ = card; | 54 card_ = card; |
| 55 save_card_callback_ = save_card_callback; | 55 save_card_callback_ = save_card_callback; |
| 56 ShowBubble(); | 56 ShowBubble(); |
| 57 } | 57 } |
| 58 | 58 |
| 59 void SaveCardBubbleControllerImpl::ShowBubbleForUpload( | 59 void SaveCardBubbleControllerImpl::ShowBubbleForUpload( |
| 60 const CreditCard& card, | 60 const CreditCard& card, |
| 61 scoped_ptr<base::DictionaryValue> legal_message, | 61 std::unique_ptr<base::DictionaryValue> legal_message, |
| 62 const base::Closure& save_card_callback) { | 62 const base::Closure& save_card_callback) { |
| 63 is_uploading_ = true; | 63 is_uploading_ = true; |
| 64 is_reshow_ = false; | 64 is_reshow_ = false; |
| 65 AutofillMetrics::LogSaveCardPromptMetric( | 65 AutofillMetrics::LogSaveCardPromptMetric( |
| 66 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, | 66 AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, is_uploading_, |
| 67 is_reshow_); | 67 is_reshow_); |
| 68 | 68 |
| 69 if (!LegalMessageLine::Parse(*legal_message, &legal_message_lines_)) { | 69 if (!LegalMessageLine::Parse(*legal_message, &legal_message_lines_)) { |
| 70 AutofillMetrics::LogSaveCardPromptMetric( | 70 AutofillMetrics::LogSaveCardPromptMetric( |
| 71 AutofillMetrics::SAVE_CARD_PROMPT_END_INVALID_LEGAL_MESSAGE, | 71 AutofillMetrics::SAVE_CARD_PROMPT_END_INVALID_LEGAL_MESSAGE, |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 location_bar->UpdateSaveCreditCardIcon(); | 224 location_bar->UpdateSaveCreditCardIcon(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { | 227 void SaveCardBubbleControllerImpl::OpenUrl(const GURL& url) { |
| 228 web_contents()->OpenURL( | 228 web_contents()->OpenURL( |
| 229 content::OpenURLParams(url, content::Referrer(), NEW_FOREGROUND_TAB, | 229 content::OpenURLParams(url, content::Referrer(), NEW_FOREGROUND_TAB, |
| 230 ui::PAGE_TRANSITION_LINK, false)); | 230 ui::PAGE_TRANSITION_LINK, false)); |
| 231 } | 231 } |
| 232 | 232 |
| 233 } // namespace autofill | 233 } // namespace autofill |
| OLD | NEW |