| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Create a PasswordGenerationPopupView if one doesn't already exist. | 65 // Create a PasswordGenerationPopupView if one doesn't already exist. |
| 66 // If |display_password| is true, a generated password is shown that can be | 66 // If |display_password| is true, a generated password is shown that can be |
| 67 // selected by the user. Otherwise just the text explaining generated | 67 // selected by the user. Otherwise just the text explaining generated |
| 68 // passwords is shown. Idempotent. | 68 // passwords is shown. Idempotent. |
| 69 void Show(bool display_password); | 69 void Show(bool display_password); |
| 70 | 70 |
| 71 // Hides the popup and destroys |this|. | 71 // Hides the popup and destroys |this|. |
| 72 void HideAndDestroy(); | 72 void HideAndDestroy(); |
| 73 | 73 |
| 74 // Accessors. | |
| 75 content::WebContents* web_contents() { | |
| 76 return controller_common_.web_contents(); | |
| 77 } | |
| 78 | |
| 79 protected: | 74 protected: |
| 80 PasswordGenerationPopupControllerImpl( | 75 PasswordGenerationPopupControllerImpl( |
| 81 const gfx::RectF& bounds, | 76 const gfx::RectF& bounds, |
| 82 const PasswordForm& form, | 77 const PasswordForm& form, |
| 83 int max_length, | 78 int max_length, |
| 84 password_manager::PasswordManager* password_manager, | 79 password_manager::PasswordManager* password_manager, |
| 85 password_manager::PasswordManagerDriver* driver, | 80 password_manager::PasswordManagerDriver* driver, |
| 86 PasswordGenerationPopupObserver* observer, | 81 PasswordGenerationPopupObserver* observer, |
| 87 content::WebContents* web_contents, | 82 content::WebContents* web_contents, |
| 88 gfx::NativeView container_view); | 83 gfx::NativeView container_view); |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 PasswordForm form_; | 129 PasswordForm form_; |
| 135 password_manager::PasswordManager* password_manager_; | 130 password_manager::PasswordManager* password_manager_; |
| 136 password_manager::PasswordManagerDriver* driver_; | 131 password_manager::PasswordManagerDriver* driver_; |
| 137 | 132 |
| 138 // May be NULL. | 133 // May be NULL. |
| 139 PasswordGenerationPopupObserver* observer_; | 134 PasswordGenerationPopupObserver* observer_; |
| 140 | 135 |
| 141 // Controls how passwords are generated. | 136 // Controls how passwords are generated. |
| 142 std::unique_ptr<PasswordGenerator> generator_; | 137 std::unique_ptr<PasswordGenerator> generator_; |
| 143 | 138 |
| 144 // Contains common popup functionality. | 139 // Contains common popup data. |
| 145 PopupControllerCommon controller_common_; | 140 const PopupControllerCommon controller_common_; |
| 146 | 141 |
| 147 // Help text and the range in the text that corresponds to the saved passwords | 142 // Help text and the range in the text that corresponds to the saved passwords |
| 148 // link. | 143 // link. |
| 149 base::string16 help_text_; | 144 base::string16 help_text_; |
| 150 gfx::Range link_range_; | 145 gfx::Range link_range_; |
| 151 | 146 |
| 152 base::string16 current_password_; | 147 base::string16 current_password_; |
| 153 bool password_selected_; | 148 bool password_selected_; |
| 154 | 149 |
| 155 // If a password will be shown in this popup. | 150 // If a password will be shown in this popup. |
| 156 bool display_password_; | 151 bool display_password_; |
| 157 | 152 |
| 158 // Bounds for all the elements of the popup. | 153 // Bounds for all the elements of the popup. |
| 159 gfx::Rect popup_bounds_; | 154 gfx::Rect popup_bounds_; |
| 160 | 155 |
| 161 PopupViewCommon view_common_; | 156 PopupViewCommon view_common_; |
| 162 | 157 |
| 158 content::WebContents* const web_contents_; |
| 159 |
| 163 base::WeakPtrFactory<PasswordGenerationPopupControllerImpl> weak_ptr_factory_; | 160 base::WeakPtrFactory<PasswordGenerationPopupControllerImpl> weak_ptr_factory_; |
| 164 | 161 |
| 165 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupControllerImpl); | 162 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationPopupControllerImpl); |
| 166 }; | 163 }; |
| 167 | 164 |
| 168 } // namespace autofill | 165 } // namespace autofill |
| 169 | 166 |
| 170 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_
H_ | 167 #endif // CHROME_BROWSER_UI_AUTOFILL_PASSWORD_GENERATION_POPUP_CONTROLLER_IMPL_
H_ |
| OLD | NEW |