OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_TEST_AUTOFILL_CREDIT_CARD_BUBBLE_H_ | |
6 #define CHROME_BROWSER_UI_AUTOFILL_TEST_AUTOFILL_CREDIT_CARD_BUBBLE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "base/memory/weak_ptr.h" | |
11 #include "chrome/browser/ui/autofill/autofill_credit_card_bubble.h" | |
12 | |
13 namespace autofill { | |
14 | |
15 //////////////////////////////////////////////////////////////////////////////// | |
16 // | |
17 // TestAutofillCreditCardBubble | |
18 // | |
19 // A cross-platform, headless bubble that doesn't conflict with other top-level | |
20 // widgets/windows. | |
21 //////////////////////////////////////////////////////////////////////////////// | |
22 class TestAutofillCreditCardBubble : public AutofillCreditCardBubble { | |
23 public: | |
24 // Creates a bubble and returns a weak reference to it. | |
25 static base::WeakPtr<TestAutofillCreditCardBubble> Create( | |
26 const base::WeakPtr<AutofillCreditCardBubbleController>& controller); | |
27 | |
28 virtual ~TestAutofillCreditCardBubble(); | |
29 | |
30 // AutofillCreditCardBubble: | |
31 virtual void Show() OVERRIDE; | |
32 virtual void Hide() OVERRIDE; | |
33 virtual bool IsHiding() const OVERRIDE; | |
34 | |
35 base::WeakPtr<TestAutofillCreditCardBubble> GetWeakPtr(); | |
36 | |
37 bool showing() const { return showing_; } | |
38 | |
39 private: | |
40 explicit TestAutofillCreditCardBubble( | |
41 const base::WeakPtr<AutofillCreditCardBubbleController>& controller); | |
42 | |
43 // Whether the bubble is currently showing or not. | |
44 bool showing_; | |
45 | |
46 base::WeakPtrFactory<TestAutofillCreditCardBubble> weak_ptr_factory_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(TestAutofillCreditCardBubble); | |
49 }; | |
50 | |
51 } // namespace autofill | |
52 | |
53 #endif // CHROME_BROWSER_UI_AUTOFILL_TEST_AUTOFILL_CREDIT_CARD_BUBBLE_H_ | |
OLD | NEW |