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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" |
| 10 #include "ui/gfx/range/range.h" |
9 | 11 |
10 namespace autofill { | 12 namespace autofill { |
11 | 13 |
12 class SaveCardBubbleView; | 14 class SaveCardBubbleView; |
13 | 15 |
14 // Interface that exposes controller functionality to SaveCardBubbleView. | 16 // Interface that exposes controller functionality to SaveCardBubbleView. |
15 class SaveCardBubbleController { | 17 class SaveCardBubbleController { |
16 public: | 18 public: |
| 19 // Interaction. |
17 virtual void OnSaveButton() = 0; | 20 virtual void OnSaveButton() = 0; |
18 virtual void OnCancelButton() = 0; | 21 virtual void OnCancelButton() = 0; |
19 virtual void OnLearnMoreClicked() = 0; | 22 virtual void OnLearnMoreClicked() = 0; |
| 23 virtual void OnLegalMessageLinkClicked(const gfx::Range& link_range) = 0; |
20 virtual void OnBubbleClosed() = 0; | 24 virtual void OnBubbleClosed() = 0; |
21 | 25 |
| 26 // State. |
| 27 |
| 28 // Returns empty string if no legal message should be shown. |
| 29 virtual const base::string16& GetLegalMessage() const = 0; |
| 30 virtual const std::vector<gfx::Range>& GetLegalMessageLinkRanges() const = 0; |
| 31 |
22 protected: | 32 protected: |
23 SaveCardBubbleController() {} | 33 SaveCardBubbleController() {} |
24 virtual ~SaveCardBubbleController() {} | 34 virtual ~SaveCardBubbleController() {} |
25 | 35 |
26 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); | 36 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
27 }; | 37 }; |
28 | 38 |
29 } // namespace autofill | 39 } // namespace autofill |
30 | 40 |
31 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 41 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
OLD | NEW |