| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 142 |
| 143 password_selected_ = selected; | 143 password_selected_ = selected; |
| 144 view_->PasswordSelectionUpdated(); | 144 view_->PasswordSelectionUpdated(); |
| 145 view_->UpdateBoundsAndRedrawPopup(); | 145 view_->UpdateBoundsAndRedrawPopup(); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void PasswordGenerationPopupControllerImpl::PasswordAccepted() { | 148 void PasswordGenerationPopupControllerImpl::PasswordAccepted() { |
| 149 if (!display_password_) | 149 if (!display_password_) |
| 150 return; | 150 return; |
| 151 | 151 |
| 152 web_contents()->GetRenderViewHost()->Send( | 152 driver_->GeneratedPasswordAccepted(current_password_); |
| 153 new AutofillMsg_GeneratedPasswordAccepted( | |
| 154 web_contents()->GetRenderViewHost()->GetRoutingID(), | |
| 155 current_password_)); | |
| 156 password_manager_->SetFormHasGeneratedPassword(driver_, form_); | 153 password_manager_->SetFormHasGeneratedPassword(driver_, form_); |
| 157 Hide(); | 154 Hide(); |
| 158 } | 155 } |
| 159 | 156 |
| 160 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { | 157 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { |
| 161 // Minimum width in pixels. | 158 // Minimum width in pixels. |
| 162 const int minimum_width = 350; | 159 const int minimum_width = 350; |
| 163 | 160 |
| 164 // If the width of the field is longer than the minimum, use that instead. | 161 // If the width of the field is longer than the minimum, use that instead. |
| 165 return std::max(minimum_width, | 162 return std::max(minimum_width, |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 | 274 |
| 278 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 275 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
| 279 return help_text_; | 276 return help_text_; |
| 280 } | 277 } |
| 281 | 278 |
| 282 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 279 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
| 283 return link_range_; | 280 return link_range_; |
| 284 } | 281 } |
| 285 | 282 |
| 286 } // namespace autofill | 283 } // namespace autofill |
| OLD | NEW |