| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLLER_
H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLLER_
H_ |
| 6 #define CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLLER_
H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLLER_
H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" | 10 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" |
| 11 | 11 |
| 12 namespace autofill { | 12 namespace autofill { |
| 13 | 13 |
| 14 class TestGeneratedCreditCardBubbleView; | 14 class TestGeneratedCreditCardBubbleView; |
| 15 | 15 |
| 16 class TestGeneratedCreditCardBubbleController | 16 class TestGeneratedCreditCardBubbleController |
| 17 : public GeneratedCreditCardBubbleController { | 17 : public GeneratedCreditCardBubbleController { |
| 18 public: | 18 public: |
| 19 explicit TestGeneratedCreditCardBubbleController( | 19 explicit TestGeneratedCreditCardBubbleController( |
| 20 content::WebContents* contents); | 20 content::WebContents* contents); |
| 21 virtual ~TestGeneratedCreditCardBubbleController(); | 21 ~TestGeneratedCreditCardBubbleController() override; |
| 22 | 22 |
| 23 // Whether this controller is installed on |web_contents()|. | 23 // Whether this controller is installed on |web_contents()|. |
| 24 bool IsInstalled() const; | 24 bool IsInstalled() const; |
| 25 | 25 |
| 26 // Get an invisible, dumb, test-only bubble. | 26 // Get an invisible, dumb, test-only bubble. |
| 27 TestGeneratedCreditCardBubbleView* GetTestingBubble(); | 27 TestGeneratedCreditCardBubbleView* GetTestingBubble(); |
| 28 | 28 |
| 29 // Made public for testing. | 29 // Made public for testing. |
| 30 using GeneratedCreditCardBubbleController::fronting_card_name; | 30 using GeneratedCreditCardBubbleController::fronting_card_name; |
| 31 using GeneratedCreditCardBubbleController::backing_card_name; | 31 using GeneratedCreditCardBubbleController::backing_card_name; |
| 32 | 32 |
| 33 int bubbles_shown() const { return bubbles_shown_; } | 33 int bubbles_shown() const { return bubbles_shown_; } |
| 34 | 34 |
| 35 protected: | 35 protected: |
| 36 // GeneratedCreditCardBubbleController: | 36 // GeneratedCreditCardBubbleController: |
| 37 virtual base::WeakPtr<GeneratedCreditCardBubbleView> CreateBubble() override; | 37 base::WeakPtr<GeneratedCreditCardBubbleView> CreateBubble() override; |
| 38 virtual bool CanShow() const override; | 38 bool CanShow() const override; |
| 39 virtual void SetupAndShow(const base::string16& fronting_card_name, | 39 void SetupAndShow(const base::string16& fronting_card_name, |
| 40 const base::string16& backing_card_name) override; | 40 const base::string16& backing_card_name) override; |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 // How many bubbles have been shown via this controller. | 43 // How many bubbles have been shown via this controller. |
| 44 int bubbles_shown_; | 44 int bubbles_shown_; |
| 45 | 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(TestGeneratedCreditCardBubbleController); | 46 DISALLOW_COPY_AND_ASSIGN(TestGeneratedCreditCardBubbleController); |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 } // namespace autofill | 49 } // namespace autofill |
| 50 | 50 |
| 51 #endif // CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLL
ER_H_ | 51 #endif // CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_CONTROLL
ER_H_ |
| OLD | NEW |