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_VIEWS_AUTOFILL_AUTOFILL_CREDIT_CARD_BUBBLE_VIEWS_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_CREDIT_CARD_BUBBLE_VIEWS_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 #include "ui/views/bubble/bubble_delegate.h" | |
13 #include "ui/views/controls/link_listener.h" | |
14 | |
15 namespace autofill { | |
16 | |
17 class AutofillCreditCardBubbleController; | |
18 | |
19 // Views toolkit implementation of AutofillCreditCard bubble (an educational | |
20 // bubble shown after a successful submission of the Autofill dialog). | |
21 class AutofillCreditCardBubbleViews : public AutofillCreditCardBubble, | |
22 public views::BubbleDelegateView, | |
23 public views::LinkListener { | |
24 public: | |
25 virtual ~AutofillCreditCardBubbleViews(); | |
26 | |
27 // AutofillCreditCardBubble: | |
28 virtual void Show() OVERRIDE; | |
29 virtual void Hide() OVERRIDE; | |
30 virtual bool IsHiding() const OVERRIDE; | |
31 | |
32 // views::BubbleDelegateView: | |
33 virtual string16 GetWindowTitle() const OVERRIDE; | |
34 virtual void Init() OVERRIDE; | |
35 virtual gfx::Size GetPreferredSize() OVERRIDE; | |
36 | |
37 // views::LinkListener: | |
38 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | |
39 | |
40 private: | |
41 friend base::WeakPtr<AutofillCreditCardBubble> | |
42 AutofillCreditCardBubble::Create( | |
43 const base::WeakPtr<AutofillCreditCardBubbleController>& controller); | |
44 | |
45 explicit AutofillCreditCardBubbleViews( | |
46 const base::WeakPtr<AutofillCreditCardBubbleController>& controller); | |
47 | |
48 // Controller that drives this bubble. Invalid when hiding. | |
49 base::WeakPtr<AutofillCreditCardBubbleController> controller_; | |
50 | |
51 base::WeakPtrFactory<AutofillCreditCardBubble> weak_ptr_factory_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(AutofillCreditCardBubbleViews); | |
54 }; | |
55 | |
56 } // namespace autofill | |
57 | |
58 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_AUTOFILL_CREDIT_CARD_BUBBLE_VIEWS_H_ | |
OLD | NEW |