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" | |
9 | 13 |
10 namespace autofill { | 14 namespace autofill { |
11 | 15 |
12 class SaveCardBubbleView; | 16 class SaveCardBubbleView; |
13 | 17 |
14 // Interface that exposes controller functionality to SaveCardBubbleView. | 18 // Interface that exposes controller functionality to SaveCardBubbleView. |
15 class SaveCardBubbleController { | 19 class SaveCardBubbleController { |
16 public: | 20 public: |
21 struct LegalMessageLine { | |
bondd
2015/11/13 01:19:52
I want to use this as POD, but chromium-style requ
| |
22 struct Link { | |
23 gfx::Range range; | |
24 std::string url; | |
Evan Stade
2015/11/13 01:33:07
nit: GURL
bondd
2015/11/13 22:30:43
Done.
| |
25 }; | |
26 | |
27 LegalMessageLine(); | |
28 ~LegalMessageLine(); | |
29 | |
30 base::string16 text; | |
31 std::vector<Link> links; | |
32 }; | |
33 | |
34 // Interaction. | |
17 virtual void OnSaveButton() = 0; | 35 virtual void OnSaveButton() = 0; |
18 virtual void OnCancelButton() = 0; | 36 virtual void OnCancelButton() = 0; |
19 virtual void OnLearnMoreClicked() = 0; | 37 virtual void OnLearnMoreClicked() = 0; |
38 virtual void OnLegalMessageLinkClicked(const std::string& url) = 0; | |
20 virtual void OnBubbleClosed() = 0; | 39 virtual void OnBubbleClosed() = 0; |
21 | 40 |
41 // State. | |
42 | |
43 // Returns empty vector if no legal message should be shown. | |
44 virtual const std::vector<LegalMessageLine>& GetLegalMessageLines() const = 0; | |
45 | |
22 protected: | 46 protected: |
23 SaveCardBubbleController() {} | 47 SaveCardBubbleController() {} |
24 virtual ~SaveCardBubbleController() {} | 48 virtual ~SaveCardBubbleController() {} |
25 | 49 |
26 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); | 50 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
27 }; | 51 }; |
28 | 52 |
29 } // namespace autofill | 53 } // namespace autofill |
30 | 54 |
31 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 55 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
OLD | NEW |