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_IMPL_H_ | 5 #ifndef CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // PasswordGenerationPopupController implementation: | 88 // PasswordGenerationPopupController implementation: |
89 virtual void Hide() OVERRIDE; | 89 virtual void Hide() OVERRIDE; |
90 virtual void ViewDestroyed() OVERRIDE; | 90 virtual void ViewDestroyed() OVERRIDE; |
91 virtual void SetSelectionAtPoint(const gfx::Point& point) OVERRIDE; | 91 virtual void SetSelectionAtPoint(const gfx::Point& point) OVERRIDE; |
92 virtual bool AcceptSelectedLine() OVERRIDE; | 92 virtual bool AcceptSelectedLine() OVERRIDE; |
93 virtual void SelectionCleared() OVERRIDE; | 93 virtual void SelectionCleared() OVERRIDE; |
94 virtual void OnSavedPasswordsLinkClicked() OVERRIDE; | 94 virtual void OnSavedPasswordsLinkClicked() OVERRIDE; |
95 virtual gfx::NativeView container_view() OVERRIDE; | 95 virtual gfx::NativeView container_view() OVERRIDE; |
96 virtual const gfx::FontList& font_list() const OVERRIDE; | 96 virtual const gfx::FontList& font_list() const OVERRIDE; |
97 virtual const gfx::Rect& popup_bounds() const OVERRIDE; | 97 virtual const gfx::Rect& popup_bounds() const OVERRIDE; |
98 virtual const gfx::Rect& password_bounds() const OVERRIDE; | |
99 virtual const gfx::Rect& divider_bounds() const OVERRIDE; | |
100 virtual const gfx::Rect& help_bounds() const OVERRIDE; | |
101 virtual bool display_password() const OVERRIDE; | 98 virtual bool display_password() const OVERRIDE; |
102 virtual bool password_selected() const OVERRIDE; | 99 virtual bool password_selected() const OVERRIDE; |
103 virtual base::string16 password() const OVERRIDE; | 100 virtual base::string16 password() const OVERRIDE; |
104 virtual base::string16 SuggestedText() OVERRIDE; | 101 virtual base::string16 SuggestedText() OVERRIDE; |
105 virtual const base::string16& HelpText() OVERRIDE; | 102 virtual const base::string16& HelpText() OVERRIDE; |
106 virtual const gfx::Range& HelpTextLinkRange() OVERRIDE; | 103 virtual const gfx::Range& HelpTextLinkRange() OVERRIDE; |
107 | 104 |
108 base::WeakPtr<PasswordGenerationPopupControllerImpl> GetWeakPtr(); | 105 base::WeakPtr<PasswordGenerationPopupControllerImpl> GetWeakPtr(); |
109 | 106 |
110 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event); | 107 bool HandleKeyPressEvent(const content::NativeWebKeyboardEvent& event); |
111 | 108 |
112 // Set if the password is currently selected. | 109 // Set if the password is currently selected. |
113 void PasswordSelected(bool selected); | 110 void PasswordSelected(bool selected); |
114 | 111 |
115 // Accept the password. Causes the controller to hide itself as the popup | 112 // Accept the password. Causes the controller to hide itself as the popup |
116 // is no longer necessary. | 113 // is no longer necessary. |
117 void PasswordAccepted(); | 114 void PasswordAccepted(); |
118 | 115 |
119 // Accept password if it's selected. | 116 // Accept password if it's selected. |
120 bool PossiblyAcceptPassword(); | 117 bool PossiblyAcceptPassword(); |
121 | 118 |
122 // Get desired size of popup. Height depends on width because we do text | 119 // Get desired size of popup. Height depends on width because we do text |
123 // wrapping. | 120 // wrapping. |
124 int GetDesiredWidth(); | 121 int GetDesiredWidth(); |
125 int GetDesiredHeight(int width); | |
126 void CalculateBounds(); | 122 void CalculateBounds(); |
127 | 123 |
128 PasswordForm form_; | 124 PasswordForm form_; |
129 password_manager::PasswordManager* password_manager_; | 125 password_manager::PasswordManager* password_manager_; |
130 | 126 |
131 // May be NULL. | 127 // May be NULL. |
132 PasswordGenerationPopupObserver* observer_; | 128 PasswordGenerationPopupObserver* observer_; |
133 | 129 |
134 // Controls how passwords are generated. | 130 // Controls how passwords are generated. |
135 scoped_ptr<PasswordGenerator> generator_; | 131 scoped_ptr<PasswordGenerator> generator_; |
(...skipping 13 matching lines...) Expand all Loading... |
149 gfx::Range link_range_; | 145 gfx::Range link_range_; |
150 | 146 |
151 base::string16 current_password_; | 147 base::string16 current_password_; |
152 bool password_selected_; | 148 bool password_selected_; |
153 | 149 |
154 // If a password will be shown in this popup. | 150 // If a password will be shown in this popup. |
155 bool display_password_; | 151 bool display_password_; |
156 | 152 |
157 // Bounds for all the elements of the popup. | 153 // Bounds for all the elements of the popup. |
158 gfx::Rect popup_bounds_; | 154 gfx::Rect popup_bounds_; |
159 gfx::Rect password_bounds_; | |
160 gfx::Rect divider_bounds_; | |
161 gfx::Rect help_bounds_; | |
162 | 155 |
163 base::WeakPtrFactory<PasswordGenerationPopupControllerImpl> weak_ptr_factory_; | 156 base::WeakPtrFactory<PasswordGenerationPopupControllerImpl> weak_ptr_factory_; |
164 | 157 |
165 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupControllerImpl); | 158 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupControllerImpl); |
166 }; | 159 }; |
167 | 160 |
168 } // namespace autofill | 161 } // namespace autofill |
169 | 162 |
170 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_
H_ | 163 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_
H_ |
OLD | NEW |