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_GENERATED_CREDIT_CARD_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_GENERATED_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/generated_credit_card_bubble.h" |
| 12 #include "ui/views/bubble/bubble_delegate.h" |
| 13 #include "ui/views/controls/styled_label_listener.h" |
| 14 |
| 15 namespace autofill { |
| 16 |
| 17 class GeneratedCreditCardBubbleController; |
| 18 |
| 19 // Views toolkit implementation of the GeneratedCreditCardBubble (an educational |
| 20 // bubble shown after a successful generation of a new credit card number). |
| 21 class GeneratedCreditCardBubbleViews : public GeneratedCreditCardBubble, |
| 22 public views::BubbleDelegateView, |
| 23 public views::StyledLabelListener { |
| 24 public: |
| 25 virtual ~GeneratedCreditCardBubbleViews(); |
| 26 |
| 27 // GeneratedCreditCardBubble: |
| 28 virtual void Show() OVERRIDE; |
| 29 virtual void Hide() OVERRIDE; |
| 30 virtual bool IsHiding() const OVERRIDE; |
| 31 |
| 32 // views::BubbleDelegateView: |
| 33 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 34 virtual base::string16 GetWindowTitle() const OVERRIDE; |
| 35 virtual void Init() OVERRIDE; |
| 36 |
| 37 // views::StyledLabelListener: |
| 38 virtual void StyledLabelLinkClicked(const ui::Range& range, int event_flags) |
| 39 OVERRIDE; |
| 40 |
| 41 private: |
| 42 friend base::WeakPtr<GeneratedCreditCardBubble> |
| 43 GeneratedCreditCardBubble::Create( |
| 44 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller); |
| 45 |
| 46 explicit GeneratedCreditCardBubbleViews( |
| 47 const base::WeakPtr<GeneratedCreditCardBubbleController>& controller); |
| 48 |
| 49 // Controller that drives this bubble. May be invalid when hiding. |
| 50 base::WeakPtr<GeneratedCreditCardBubbleController> controller_; |
| 51 |
| 52 base::WeakPtrFactory<GeneratedCreditCardBubble> weak_ptr_factory_; |
| 53 |
| 54 DISALLOW_COPY_AND_ASSIGN(GeneratedCreditCardBubbleViews); |
| 55 }; |
| 56 |
| 57 } // namespace autofill |
| 58 |
| 59 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_GENERATED_CREDIT_CARD_BUBBLE_VIEWS_H
_ |
OLD | NEW |