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_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
10 | 10 |
11 class Browser; | 11 class Browser; |
12 class CommandUpdater; | 12 class CommandUpdater; |
13 | 13 |
14 namespace autofill { | 14 namespace autofill { |
15 | 15 |
| 16 class SaveCardBubbleControllerImpl; |
| 17 |
16 // The location bar icon to show the Save Credit Card bubble where the user can | 18 // The location bar icon to show the Save Credit Card bubble where the user can |
17 // choose to save the credit card info to use again later without re-entering | 19 // choose to save the credit card info to use again later without re-entering |
18 // it. | 20 // it. |
19 class SaveCardIconView : public BubbleIconView { | 21 class SaveCardIconView : public BubbleIconView { |
20 public: | 22 public: |
21 explicit SaveCardIconView(CommandUpdater* command_updater, Browser* browser); | 23 explicit SaveCardIconView(CommandUpdater* command_updater, Browser* browser); |
22 ~SaveCardIconView() override; | 24 ~SaveCardIconView() override; |
23 | 25 |
24 protected: | 26 protected: |
25 // BubbleIconView: | 27 // BubbleIconView: |
26 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; | 28 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; |
| 29 bool OnMousePressed(const ui::MouseEvent& event) override; |
27 views::BubbleDelegateView* GetBubble() const override; | 30 views::BubbleDelegateView* GetBubble() const override; |
28 gfx::VectorIconId GetVectorIcon() const override; | 31 gfx::VectorIconId GetVectorIcon() const override; |
29 | 32 |
30 private: | 33 private: |
| 34 SaveCardBubbleControllerImpl* GetController() const; |
| 35 |
31 // May be nullptr. | 36 // May be nullptr. |
32 Browser* browser_; | 37 Browser* browser_; |
33 | 38 |
34 DISALLOW_COPY_AND_ASSIGN(SaveCardIconView); | 39 DISALLOW_COPY_AND_ASSIGN(SaveCardIconView); |
35 }; | 40 }; |
36 | 41 |
37 } // namespace autofill | 42 } // namespace autofill |
38 | 43 |
39 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ | 44 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ |
OLD | NEW |