Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / views / autofill / new_credit_card_bubble_views.h
blob2caf84f0109f7a9f5f14b3d4c61bf20ef6aa58ed
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_VIEWS_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_VIEWS_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_VIEWS_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/new_credit_card_bubble_view.h"
12 #include "ui/views/bubble/bubble_delegate.h"
13 #include "ui/views/controls/link_listener.h"
15 namespace autofill {
17 class NewCreditCardBubbleController;
19 // Views toolkit implementation of NewCreditCardBubbleView (a bubble shown after
20 // a user saved a new card locally in Chrome).
21 class NewCreditCardBubbleViews : public NewCreditCardBubbleView,
22 public views::BubbleDelegateView,
23 public views::LinkListener {
24 public:
25 ~NewCreditCardBubbleViews() override;
27 // NewCreditCardBubbleView:
28 void Show() override;
29 void Hide() override;
31 // views::BubbleDelegateView:
32 gfx::Size GetPreferredSize() const override;
33 base::string16 GetWindowTitle() const override;
34 void Init() override;
35 gfx::Rect GetBubbleBounds() override;
37 // views::LinkListener:
38 void LinkClicked(views::Link* source, int event_flags) override;
40 private:
41 friend base::WeakPtr<NewCreditCardBubbleView> NewCreditCardBubbleView::Create(
42 NewCreditCardBubbleController* controller);
44 explicit NewCreditCardBubbleViews(
45 NewCreditCardBubbleController* controller);
47 // Controller that drives this bubble. Never NULL; outlives this class.
48 NewCreditCardBubbleController* controller_;
50 base::WeakPtrFactory<NewCreditCardBubbleView> weak_ptr_factory_;
52 DISALLOW_COPY_AND_ASSIGN(NewCreditCardBubbleViews);
55 } // namespace autofill
57 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_NEW_CREDIT_CARD_BUBBLE_VIEWS_H_