OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ |
7 | 7 |
8 namespace autofill { | 8 namespace autofill { |
9 | 9 |
10 // Functions that an AutofillDialogView implementation should implement in order | 10 // Functions that an AutofillDialogView implementation should implement in order |
11 // to assist in unit testing. | 11 // to assist in unit testing. |
12 class TestableAutofillDialogView { | 12 class TestableAutofillDialogView { |
13 public: | 13 public: |
14 virtual ~TestableAutofillDialogView() {} | 14 virtual ~TestableAutofillDialogView() {} |
15 | 15 |
16 // Simulates the user pressing 'Submit' to accept the dialog. | 16 // Simulates the user pressing 'Submit' to accept the dialog. |
17 virtual void SubmitForTesting() = 0; | 17 virtual void SubmitForTesting() = 0; |
18 | 18 |
19 // Simulates the user pressing 'Cancel' to abort the dialog. | 19 // Simulates the user pressing 'Cancel' to abort the dialog. |
20 virtual void CancelForTesting() = 0; | 20 virtual void CancelForTesting() = 0; |
21 | 21 |
22 // Returns the actual contents of the input which is modelled by |input|. | 22 // Returns the actual contents of the input of |type|. |
23 virtual base::string16 GetTextContentsOfInput(const DetailInput& input) = 0; | 23 virtual base::string16 GetTextContentsOfInput(ServerFieldType type) = 0; |
24 | 24 |
25 // Sets the actual contents of the input which is modelled by |input|. | 25 // Sets the actual contents of the input of |type|. |
26 virtual void SetTextContentsOfInput(const DetailInput& input, | 26 virtual void SetTextContentsOfInput(ServerFieldType type, |
27 const base::string16& contents) = 0; | 27 const base::string16& contents) = 0; |
28 | 28 |
29 // Sets the content of the extra field for a section. | 29 // Sets the content of the extra field for a section. |
30 virtual void SetTextContentsOfSuggestionInput(DialogSection section, | 30 virtual void SetTextContentsOfSuggestionInput(DialogSection section, |
31 const base::string16& text) = 0; | 31 const base::string16& text) = 0; |
32 | 32 |
33 // Simulates a user activatino of the input which is modelled by |input|. | 33 // Simulates a user activation of the input of |type|. |
34 virtual void ActivateInput(const DetailInput& input) = 0; | 34 virtual void ActivateInput(ServerFieldType type) = 0; |
35 | 35 |
36 // Get the size of the entire view. | 36 // Get the size of the entire view. |
37 virtual gfx::Size GetSize() const = 0; | 37 virtual gfx::Size GetSize() const = 0; |
38 | 38 |
39 // Get the web contents used to sign in to Google. | 39 // Get the web contents used to sign in to Google. |
40 virtual content::WebContents* GetSignInWebContents() = 0; | 40 virtual content::WebContents* GetSignInWebContents() = 0; |
41 | 41 |
42 // Whether the overlay is visible. | 42 // Whether the overlay is visible. |
43 virtual bool IsShowingOverlay() const = 0; | 43 virtual bool IsShowingOverlay() const = 0; |
44 }; | 44 }; |
45 | 45 |
46 } // namespace autofill | 46 } // namespace autofill |
47 | 47 |
48 #endif // CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ | 48 #endif // CHROME_BROWSER_UI_AUTOFILL_TESTABLE_AUTOFILL_DIALOG_VIEW_H_ |
OLD | NEW |