Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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_SAVE_CARD_BUBBLE_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEWS_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEWS_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEWS_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/autofill/save_card_bubble_controller.h" | 9 #include "chrome/browser/ui/autofill/save_card_bubble_controller.h" |
| 10 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" | 10 #include "chrome/browser/ui/autofill/save_card_bubble_view.h" |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 public views::LinkListener, | 34 public views::LinkListener, |
| 35 public views::StyledLabelListener { | 35 public views::StyledLabelListener { |
| 36 public: | 36 public: |
| 37 // Bubble will be anchored to |anchor_view|. | 37 // Bubble will be anchored to |anchor_view|. |
| 38 SaveCardBubbleViews(views::View* anchor_view, | 38 SaveCardBubbleViews(views::View* anchor_view, |
| 39 content::WebContents* web_contents, | 39 content::WebContents* web_contents, |
| 40 SaveCardBubbleController* controller); | 40 SaveCardBubbleController* controller); |
| 41 | 41 |
| 42 void Show(DisplayReason reason); | 42 void Show(DisplayReason reason); |
| 43 | 43 |
| 44 // Closes the currently shown bubble if one exists. | |
| 45 static void CloseBubble(); | |
|
Justin Donnelly
2016/01/07 19:28:12
The static method is unfortunate given the otherwi
| |
| 46 | |
| 44 // SaveCardBubbleView | 47 // SaveCardBubbleView |
| 45 void Hide() override; | 48 void Hide() override; |
| 46 | 49 |
| 47 // views::WidgetDelegate | 50 // views::WidgetDelegate |
| 48 views::View* GetInitiallyFocusedView() override; | 51 views::View* GetInitiallyFocusedView() override; |
| 49 base::string16 GetWindowTitle() const override; | 52 base::string16 GetWindowTitle() const override; |
| 50 bool ShouldShowWindowTitle() const override; | 53 bool ShouldShowWindowTitle() const override; |
| 51 void WindowClosing() override; | 54 void WindowClosing() override; |
| 52 | 55 |
| 53 // views::ButtonListener | 56 // views::ButtonListener |
| 54 void ButtonPressed(views::Button* sender, const ui::Event& event) override; | 57 void ButtonPressed(views::Button* sender, const ui::Event& event) override; |
| 55 | 58 |
| 56 // views::LinkListener | 59 // views::LinkListener |
| 57 void LinkClicked(views::Link* source, int event_flags) override; | 60 void LinkClicked(views::Link* source, int event_flags) override; |
| 58 | 61 |
| 59 // views::StyledLabelListener | 62 // views::StyledLabelListener |
| 60 void StyledLabelLinkClicked(views::StyledLabel* label, | 63 void StyledLabelLinkClicked(views::StyledLabel* label, |
| 61 const gfx::Range& range, | 64 const gfx::Range& range, |
| 62 int event_flags) override; | 65 int event_flags) override; |
| 63 | 66 |
| 64 private: | 67 private: |
| 65 ~SaveCardBubbleViews() override; | 68 ~SaveCardBubbleViews() override; |
| 66 | 69 |
| 67 scoped_ptr<views::View> CreateMainContentView(); | 70 scoped_ptr<views::View> CreateMainContentView(); |
| 68 scoped_ptr<views::View> CreateFootnoteView(); | 71 scoped_ptr<views::View> CreateFootnoteView(); |
| 69 | 72 |
| 70 // views::BubbleDelegateView | 73 // views::BubbleDelegateView |
| 71 void Init() override; | 74 void Init() override; |
| 72 | 75 |
| 76 static SaveCardBubbleViews* save_card_bubble_view_; | |
| 77 | |
| 73 SaveCardBubbleController* controller_; // Weak reference. | 78 SaveCardBubbleController* controller_; // Weak reference. |
| 74 | 79 |
| 75 // Button for the user to confirm saving the credit card info. | 80 // Button for the user to confirm saving the credit card info. |
| 76 views::LabelButton* save_button_; | 81 views::LabelButton* save_button_; |
| 77 | 82 |
| 78 views::LabelButton* cancel_button_; | 83 views::LabelButton* cancel_button_; |
| 79 | 84 |
| 80 views::Link* learn_more_link_; | 85 views::Link* learn_more_link_; |
| 81 | 86 |
| 82 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleViews); | 87 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleViews); |
| 83 }; | 88 }; |
| 84 | 89 |
| 85 } // namespace autofill | 90 } // namespace autofill |
| 86 | 91 |
| 87 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEWS_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_BUBBLE_VIEWS_H_ |
| OLD | NEW |