OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ |
7 | 7 |
8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
9 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" | 9 #include "chrome/browser/ui/autofill/autofill_popup_view_delegate.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class FontList; | |
13 class Range; | 12 class Range; |
14 } | 13 } |
15 | 14 |
16 namespace autofill { | 15 namespace autofill { |
17 | 16 |
18 class PasswordGenerationPopupController : public AutofillPopupViewDelegate { | 17 class PasswordGenerationPopupController : public AutofillPopupViewDelegate { |
19 public: | 18 public: |
20 // Space above and below the password section. | |
21 static const int kPasswordVerticalPadding = 16; | |
22 | |
23 // Space above and below help section. | 19 // Space above and below help section. |
24 static const int kHelpVerticalPadding = 15; | 20 static const int kHelpVerticalPadding = 15; |
25 | 21 |
26 // Spacing between the border of the popup and any text. | 22 // Spacing between the border of the popup and any text. |
27 static const int kHorizontalPadding = 10; | 23 static const int kHorizontalPadding = 10; |
28 | 24 |
29 // Called by the view when the saved passwords link is clicked. | 25 // Called by the view when the saved passwords link is clicked. |
30 virtual void OnSavedPasswordsLinkClicked() = 0; | 26 virtual void OnSavedPasswordsLinkClicked() = 0; |
31 | 27 |
| 28 // Return the minimum allowable width for the popup. |
| 29 virtual int GetMinimumWidth() = 0; |
| 30 |
32 // Accessors | 31 // Accessors |
33 virtual const gfx::FontList& font_list() const = 0; | |
34 virtual const gfx::Rect& password_bounds() const = 0; | |
35 virtual const gfx::Rect& divider_bounds() const = 0; | |
36 virtual const gfx::Rect& help_bounds() const = 0; | |
37 virtual bool display_password() const = 0; | 32 virtual bool display_password() const = 0; |
38 virtual bool password_selected() const = 0; | 33 virtual bool password_selected() const = 0; |
39 virtual base::string16 password() const = 0; | 34 virtual base::string16 password() const = 0; |
40 | 35 |
41 // Translated strings | 36 // Translated strings |
42 virtual base::string16 SuggestedText() = 0; | 37 virtual base::string16 SuggestedText() = 0; |
43 virtual const base::string16& HelpText() = 0; | 38 virtual const base::string16& HelpText() = 0; |
44 virtual const gfx::Range& HelpTextLinkRange() = 0; | 39 virtual const gfx::Range& HelpTextLinkRange() = 0; |
45 | 40 |
46 protected: | 41 protected: |
47 virtual ~PasswordGenerationPopupController() {} | 42 virtual ~PasswordGenerationPopupController() {} |
48 }; | 43 }; |
49 | 44 |
50 } // namespace autofill | 45 } // namespace autofill |
51 | 46 |
52 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ | 47 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_H_ |
OLD | NEW |