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