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_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
7 | 7 |
| 8 #include <vector> |
| 9 |
8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/strings/string16.h" |
| 12 #include "ui/gfx/range/range.h" |
| 13 #include "url/gurl.h" |
9 | 14 |
10 namespace autofill { | 15 namespace autofill { |
11 | 16 |
12 class SaveCardBubbleView; | 17 class SaveCardBubbleView; |
13 | 18 |
14 // Interface that exposes controller functionality to SaveCardBubbleView. | 19 // Interface that exposes controller functionality to SaveCardBubbleView. |
15 class SaveCardBubbleController { | 20 class SaveCardBubbleController { |
16 public: | 21 public: |
| 22 struct LegalMessageLine { |
| 23 struct Link { |
| 24 gfx::Range range; |
| 25 GURL url; |
| 26 }; |
| 27 |
| 28 LegalMessageLine(); |
| 29 ~LegalMessageLine(); |
| 30 |
| 31 base::string16 text; |
| 32 std::vector<Link> links; |
| 33 }; |
| 34 |
| 35 // Interaction. |
17 virtual void OnSaveButton() = 0; | 36 virtual void OnSaveButton() = 0; |
18 virtual void OnCancelButton() = 0; | 37 virtual void OnCancelButton() = 0; |
19 virtual void OnLearnMoreClicked() = 0; | 38 virtual void OnLearnMoreClicked() = 0; |
| 39 virtual void OnLegalMessageLinkClicked(const GURL& url) = 0; |
20 virtual void OnBubbleClosed() = 0; | 40 virtual void OnBubbleClosed() = 0; |
21 | 41 |
| 42 // State. |
| 43 |
| 44 // Returns empty vector if no legal message should be shown. |
| 45 virtual const std::vector<LegalMessageLine>& GetLegalMessageLines() const = 0; |
| 46 |
22 protected: | 47 protected: |
23 SaveCardBubbleController() {} | 48 SaveCardBubbleController() {} |
24 virtual ~SaveCardBubbleController() {} | 49 virtual ~SaveCardBubbleController() {} |
25 | 50 |
26 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); | 51 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
27 }; | 52 }; |
28 | 53 |
29 } // namespace autofill | 54 } // namespace autofill |
30 | 55 |
31 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 56 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
OLD | NEW |