- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / autofill / generated_credit_card_bubble_view.h
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_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_
7
8 #include "base/memory/weak_ptr.h"
9
10 namespace autofill {
11
12 class GeneratedCreditCardBubbleController;
13
14 // A cross-platform interface for a bubble shown to educate users after a credit
15 // card number is generated. Anchored to an omnibox icon and shown either on
16 // creation or when the anchor is clicked. Hidden when focus is lost.
17 class GeneratedCreditCardBubbleView {
18  public:
19   // The preferred size of the bubble's contents.
20   static const int kContentsWidth;
21
22   virtual ~GeneratedCreditCardBubbleView();
23
24   // Visually reveals the bubble.
25   virtual void Show() = 0;
26
27   // Hides the bubble from view.
28   virtual void Hide() = 0;
29
30   // Returns whether the bubble is currently in the process of hiding itself.
31   virtual bool IsHiding() const = 0;
32
33   // Creates a bubble that's operated by |controller| and owns itself.
34   // |controller| may be invalid while the bubble is closing.
35   static base::WeakPtr<GeneratedCreditCardBubbleView> Create(
36       const base::WeakPtr<GeneratedCreditCardBubbleController>& controller);
37 };
38
39 }  // namespace autofill
40
41 #endif  // CHROME_BROWSER_UI_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_VIEW_H_