Chromium Code Reviews| Index: chrome/browser/ui/views/autofill/save_card_bubble_view.h |
| diff --git a/chrome/browser/ui/views/autofill/save_card_bubble_view.h b/chrome/browser/ui/views/autofill/save_card_bubble_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..ad9bfe9117239659bbb3159fd986804c5eac1c87 |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/autofill/save_card_bubble_view.h |
| @@ -0,0 +1,72 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEW_H_ |
| + |
| +#include "chrome/browser/ui/views/managed_full_screen_bubble_delegate_view.h" |
| +#include "ui/views/controls/button/button.h" |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace views { |
| +class LabelButton; |
| +} |
| + |
| +namespace autofill { |
| + |
| +class SaveCardBubbleController; |
| + |
| +// This class displays the "Save credit card?" bubble. |
| +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
|
| + public views::ButtonListener { |
| + public: |
| + ~SaveCardBubbleView() override; |
| + |
| + // Shows the "Save credit card?" bubble anchored to |anchor_view|. |
| + static void ShowBubble(views::View* anchor_view, |
| + content::WebContents* web_contents, |
| + SaveCardBubbleController* controller); |
| + |
| + // Closes the current bubble if it exists. |
| + static void CloseBubble(); |
| + |
| + // 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.
|
| + static SaveCardBubbleView* GetCurrentBubble(); |
| + |
| + // views::WidgetDelegate |
| + views::View* GetInitiallyFocusedView() override; |
| + base::string16 GetWindowTitle() const override; |
| + bool ShouldShowWindowTitle() const override; |
| + void WindowClosing() override; |
| + |
| + // views::ButtonListener |
| + void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| + |
| + private: |
| + SaveCardBubbleView(views::View* anchor_view, |
| + content::WebContents* web_contents, |
| + SaveCardBubbleController* controller); |
| + |
| + // views::BubbleDelegateView |
| + void Init() override; |
| + |
| + static SaveCardBubbleView* save_card_bubble_view_; |
| + |
| + // Controller must outlive this object. |
| + 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
|
| + |
| + // Button for the user to confirm saving the credit card info. |
| + views::LabelButton* save_button_; |
| + |
| + views::LabelButton* cancel_button_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleView); |
| +}; |
| + |
| +} // namespace autofill |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEW_H_ |