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 | |
31 virtual size_t GetLegalMessageNumLinks() const = 0; | |
Evan Stade
2015/11/07 03:03:19
combine these into one fn that returns a const ref
bondd
2015/11/11 01:53:36
Done.
| |
32 virtual const gfx::Range& GetLegalMessageLinkRange(size_t index) const = 0; | |
33 | |
22 protected: | 34 protected: |
23 SaveCardBubbleController() {} | 35 SaveCardBubbleController() {} |
24 virtual ~SaveCardBubbleController() {} | 36 virtual ~SaveCardBubbleController() {} |
25 | 37 |
26 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); | 38 DISALLOW_COPY_AND_ASSIGN(SaveCardBubbleController); |
27 }; | 39 }; |
28 | 40 |
29 } // namespace autofill | 41 } // namespace autofill |
30 | 42 |
31 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ | 43 #endif // CHROME_BROWSER_UI_AUTOFILL_SAVE_CARD_BUBBLE_CONTROLLER_H_ |
OLD | NEW |