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(); | |
Evan Stade
2015/11/18 00:21:13
are you sure it's necessary to define this outside
bondd
2015/11/18 01:59:39
Yes. If I get rid of the constructor and destructo
| |
29 ~LegalMessageLine(); | |
30 | |
31 base::string16 text; | |
32 std::vector<Link> links; | |
33 }; | |
34 | |
35 typedef std::vector<LegalMessageLine> LegalMessageLines; | |
36 | |
37 // Interaction. | |
17 virtual void OnSaveButton() = 0; | 38 virtual void OnSaveButton() = 0; |
18 virtual void OnCancelButton() = 0; | 39 virtual void OnCancelButton() = 0; |
19 virtual void OnLearnMoreClicked() = 0; | 40 virtual void OnLearnMoreClicked() = 0; |
41 virtual void OnLegalMessageLinkClicked(const GURL& url) = 0; | |
20 virtual void OnBubbleClosed() = 0; | 42 virtual void OnBubbleClosed() = 0; |
21 | 43 |
44 // State. | |
45 | |
46 // Returns empty vector if no legal message should be shown. | |
47 virtual const LegalMessageLines& GetLegalMessageLines() const = 0; | |
48 | |
22 protected: | 49 protected: |
23 SaveCardBubbleController() {} | 50 SaveCardBubbleController() {} |
24 virtual ~SaveCardBubbleController() {} | 51 virtual ~SaveCardBubbleController() {} |
25 | 52 |
26 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); | 53 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
27 }; | 54 }; |
28 | 55 |
29 } // namespace autofill | 56 } // namespace autofill |
30 | 57 |
31 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 58 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
OLD | NEW |