Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/ui/views/autofill/save_card_bubble_view.h

Issue 1396923003: Autofill: Replace "save credit card" infobar with a bubble (Views only). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 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_SAVE_CARD_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEW_H_
7
8 #include "chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h"
9 #include "ui/views/controls/button/button.h"
10
11 namespace content {
12 class WebContents;
13 }
14
15 namespace views {
16 class LabelButton;
17 }
18
19 namespace autofill {
20
21 class SaveCardBubbleController;
22
23 // This class displays the "Save credit card?" bubble.
24 class SaveCardBubbleView : public ManagedFullScreenBubbleDelegateView,
Evan Stade 2015/10/09 18:54:44 huh?
bondd 2015/10/13 02:03:16 Are you wondering why I'm using ManagedFullScreenB
Evan Stade 2015/10/13 02:21:55 yes, i was wondering that. It seems like the right
bondd 2015/10/15 22:27:07 If it's okay with you I'd like to land this CL fir
25 public views::ButtonListener {
26 public:
27 ~SaveCardBubbleView() override;
28
29 // Shows the "Save credit card?" bubble anchored to |anchor_view|.
30 static void ShowBubble(views::View* anchor_view,
31 content::WebContents* web_contents,
32 SaveCardBubbleController* controller);
33
34 // Closes the current bubble if it exists.
35 static void CloseBubble();
36
37 // Returns the bubble view currently shown. This may return NULL.
Evan Stade 2015/10/09 18:54:44 nullptr
bondd 2015/10/15 22:27:07 Done. GetCurrentBubble() no longer exists.
38 static SaveCardBubbleView* GetCurrentBubble();
39
40 // views::WidgetDelegate
41 views::View* GetInitiallyFocusedView() override;
42 base::string16 GetWindowTitle() const override;
43 bool ShouldShowWindowTitle() const override;
44 void WindowClosing() override;
45
46 // views::ButtonListener
47 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
48
49 private:
50 SaveCardBubbleView(views::View* anchor_view,
51 content::WebContents* web_contents,
52 SaveCardBubbleController* controller);
53
54 // views::BubbleDelegateView
55 void Init() override;
56
57 static SaveCardBubbleView* save_card_bubble_view_;
58
59 // Controller must outlive this object.
60 SaveCardBubbleController* controller_;
bondd 2015/10/09 01:36:02 Should I make this a WeakPtr?
Evan Stade 2015/10/09 18:54:44 not if it must outlive |this|. Only make it a Weak
bondd 2015/10/13 02:03:16 The bubbles that seem closest to what I'm trying t
Evan Stade 2015/10/13 02:21:55 I'm wary of agreeing to this just on the basis of
bondd 2015/10/15 22:27:07 I made the controller a WebContentsUserData. I mad
61
62 // Button for the user to confirm saving the credit card info.
63 views::LabelButton* save_button_;
64
65 views::LabelButton* cancel_button_;
66
67 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleView);
68 };
69
70 } // namespace autofill
71
72 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698