| 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_; | |
| 166 password_manager_->SetHasGeneratedPasswordForForm(driver_, form_, true); | 165 password_manager_->SetHasGeneratedPasswordForForm(driver_, form_, true); |
| 167 Hide(); | 166 Hide(); |
| 168 } | 167 } |
| 169 | 168 |
| 170 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { | 169 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { |
| 171 // Minimum width in pixels. | 170 // Minimum width in pixels. |
| 172 const int minimum_width = 350; | 171 const int minimum_width = 350; |
| 173 | 172 |
| 174 // If the width of the field is longer than the minimum, use that instead. | 173 // If the width of the field is longer than the minimum, use that instead. |
| 175 return std::max(minimum_width, | 174 return std::max(minimum_width, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 293 |
| 295 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 294 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
| 296 return help_text_; | 295 return help_text_; |
| 297 } | 296 } |
| 298 | 297 |
| 299 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 298 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
| 300 return link_range_; | 299 return link_range_; |
| 301 } | 300 } |
| 302 | 301 |
| 303 } // namespace autofill | 302 } // namespace autofill |
| OLD | NEW |