Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / ui / autofill / test_generated_credit_card_bubble_view.h
bloba37e965f04c28c47374e7c9965b631b85e44465e
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.
5 #ifndef CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "base/memory/weak_ptr.h"
11 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_view.h"
13 namespace autofill {
15 ////////////////////////////////////////////////////////////////////////////////
17 // TestGeneratedCreditCardBubbleView
19 // A cross-platform, headless bubble that doesn't conflict with other top-level
20 // widgets/windows.
22 ////////////////////////////////////////////////////////////////////////////////
23 class TestGeneratedCreditCardBubbleView : public GeneratedCreditCardBubbleView {
24 public:
25 // Creates a bubble and returns a weak reference to it.
26 static base::WeakPtr<TestGeneratedCreditCardBubbleView> Create(
27 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller);
29 ~TestGeneratedCreditCardBubbleView() override;
31 // GeneratedCreditCardBubbleView:
32 void Show() override;
33 void Hide() override;
34 bool IsHiding() const override;
36 base::WeakPtr<TestGeneratedCreditCardBubbleView> GetWeakPtr();
38 bool showing() const { return showing_; }
40 private:
41 explicit TestGeneratedCreditCardBubbleView(
42 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller);
44 // A weak reference to the controller that operates this bubble.
45 base::WeakPtr<GeneratedCreditCardBubbleController> controller_;
47 // Whether the bubble is currently showing or not.
48 bool showing_;
50 base::WeakPtrFactory<TestGeneratedCreditCardBubbleView> weak_ptr_factory_;
52 DISALLOW_COPY_AND_ASSIGN(TestGeneratedCreditCardBubbleView);
55 } // namespace autofill
57 #endif // CHROME_BROWSER_UI_AUTOFILL_TEST_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_