| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 protected: | 114 protected: |
| 115 TestSaveCardBubbleControllerImpl* controller() { | 115 TestSaveCardBubbleControllerImpl* controller() { |
| 116 return static_cast<TestSaveCardBubbleControllerImpl*>( | 116 return static_cast<TestSaveCardBubbleControllerImpl*>( |
| 117 TestSaveCardBubbleControllerImpl::FromWebContents( | 117 TestSaveCardBubbleControllerImpl::FromWebContents( |
| 118 browser()->tab_strip_model()->GetActiveWebContents())); | 118 browser()->tab_strip_model()->GetActiveWebContents())); |
| 119 } | 119 } |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 class TestSaveCardBubbleView : public SaveCardBubbleView { | 122 class TestSaveCardBubbleView : public SaveCardBubbleView { |
| 123 void Hide() override{}; | 123 void Hide() override {} |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 class SaveCardBubbleTestBrowserWindow : public TestBrowserWindow { | 126 class SaveCardBubbleTestBrowserWindow : public TestBrowserWindow { |
| 127 public: | 127 public: |
| 128 SaveCardBubbleView* ShowSaveCreditCardBubble( | 128 SaveCardBubbleView* ShowSaveCreditCardBubble( |
| 129 content::WebContents* contents, | 129 content::WebContents* contents, |
| 130 SaveCardBubbleController* controller, | 130 SaveCardBubbleController* controller, |
| 131 bool user_gesture) override { | 131 bool user_gesture) override { |
| 132 if (!save_card_bubble_view_) | 132 if (!save_card_bubble_view_) |
| 133 save_card_bubble_view_.reset(new TestSaveCardBubbleView()); | 133 save_card_bubble_view_.reset(new TestSaveCardBubbleView()); |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 "Autofill.SaveCreditCardPrompt.Upload.FirstShow"), | 517 "Autofill.SaveCreditCardPrompt.Upload.FirstShow"), |
| 518 ElementsAre(Bucket(AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, 1), | 518 ElementsAre(Bucket(AutofillMetrics::SAVE_CARD_PROMPT_SHOW_REQUESTED, 1), |
| 519 Bucket(AutofillMetrics::SAVE_CARD_PROMPT_SHOWN, 1))); | 519 Bucket(AutofillMetrics::SAVE_CARD_PROMPT_SHOWN, 1))); |
| 520 EXPECT_TRUE( | 520 EXPECT_TRUE( |
| 521 histogram_tester | 521 histogram_tester |
| 522 .GetAllSamples("Autofill.SaveCreditCardPrompt.Local.FirstShow") | 522 .GetAllSamples("Autofill.SaveCreditCardPrompt.Local.FirstShow") |
| 523 .empty()); | 523 .empty()); |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace autofill | 526 } // namespace autofill |
| OLD | NEW |