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 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" | 5 #include "chrome/browser/ui/autofill/password_generation_popup_controller_impl.h
" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 password_selected_ = selected; | 155 password_selected_ = selected; |
156 view_->PasswordSelectionUpdated(); | 156 view_->PasswordSelectionUpdated(); |
157 view_->UpdateBoundsAndRedrawPopup(); | 157 view_->UpdateBoundsAndRedrawPopup(); |
158 } | 158 } |
159 | 159 |
160 void PasswordGenerationPopupControllerImpl::PasswordAccepted() { | 160 void PasswordGenerationPopupControllerImpl::PasswordAccepted() { |
161 if (!display_password_) | 161 if (!display_password_) |
162 return; | 162 return; |
163 | 163 |
164 driver_->GeneratedPasswordAccepted(current_password_); | 164 driver_->GeneratedPasswordAccepted(current_password_); |
| 165 form_.new_password_value = current_password_; |
165 password_manager_->SetHasGeneratedPasswordForForm(driver_, form_, true); | 166 password_manager_->SetHasGeneratedPasswordForForm(driver_, form_, true); |
166 Hide(); | 167 Hide(); |
167 } | 168 } |
168 | 169 |
169 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { | 170 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { |
170 // Minimum width in pixels. | 171 // Minimum width in pixels. |
171 const int minimum_width = 350; | 172 const int minimum_width = 350; |
172 | 173 |
173 // If the width of the field is longer than the minimum, use that instead. | 174 // If the width of the field is longer than the minimum, use that instead. |
174 return std::max(minimum_width, | 175 return std::max(minimum_width, |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 294 |
294 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 295 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
295 return help_text_; | 296 return help_text_; |
296 } | 297 } |
297 | 298 |
298 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 299 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
299 return link_range_; | 300 return link_range_; |
300 } | 301 } |
301 | 302 |
302 } // namespace autofill | 303 } // namespace autofill |
OLD | NEW |