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 // The location bar icon to show the Save Credit Card bubble where the user can | 16 // 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 | 17 // choose to save the credit card info to use again later without re-entering |
18 // it. | 18 // it. |
19 class SaveCardIconView : public BubbleIconView { | 19 class SaveCardIconView : public BubbleIconView { |
20 public: | 20 public: |
21 explicit SaveCardIconView(CommandUpdater* command_updater, Browser* browser); | 21 explicit SaveCardIconView(CommandUpdater* command_updater, Browser* browser); |
22 ~SaveCardIconView() override; | 22 ~SaveCardIconView() override; |
23 | 23 |
24 // Toggles the icon on or off. | |
25 void SetToggled(bool on); | |
26 | |
27 protected: | 24 protected: |
28 // BubbleIconView: | 25 // BubbleIconView: |
29 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; | 26 void OnExecuting(BubbleIconView::ExecuteSource execute_source) override; |
30 views::BubbleDelegateView* GetBubble() const override; | 27 views::BubbleDelegateView* GetBubble() const override; |
31 gfx::VectorIconId GetVectorIcon() const override; | 28 gfx::VectorIconId GetVectorIcon() const override; |
32 | 29 |
33 private: | 30 private: |
34 // May be nullptr. | 31 // May be nullptr. |
35 Browser* browser_; | 32 Browser* browser_; |
36 | 33 |
37 DISALLOW_COPY_AND_ASSIGN(SaveCardIconView); | 34 DISALLOW_COPY_AND_ASSIGN(SaveCardIconView); |
38 }; | 35 }; |
39 | 36 |
40 } // namespace autofill | 37 } // namespace autofill |
41 | 38 |
42 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ | 39 #endif // CHROME_BROWSER_UI_VIEWS_AUTOFILL_SAVE_CARD_ICON_VIEW_H_ |
OLD | NEW |