| 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/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 web_contents()->GetRenderViewHost()->Send( | 149 web_contents()->GetRenderViewHost()->Send( |
| 150 new AutofillMsg_GeneratedPasswordAccepted( | 150 new AutofillMsg_GeneratedPasswordAccepted( |
| 151 web_contents()->GetRenderViewHost()->GetRoutingID(), | 151 web_contents()->GetRenderViewHost()->GetRoutingID(), |
| 152 current_password_)); | 152 current_password_)); |
| 153 password_manager_->SetFormHasGeneratedPassword(form_); | 153 password_manager_->SetFormHasGeneratedPassword(form_); |
| 154 Hide(); | 154 Hide(); |
| 155 } | 155 } |
| 156 | 156 |
| 157 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { | 157 int PasswordGenerationPopupControllerImpl::GetMinimumWidth() { |
| 158 // Minimum width in pixels. | 158 // Minimum width in pixels. |
| 159 const int minimum_width = 360; | 159 const int minimum_width = 350; |
| 160 | 160 |
| 161 // 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. |
| 162 return std::max(minimum_width, | 162 return std::max(minimum_width, |
| 163 controller_common_.RoundedElementBounds().width()); | 163 controller_common_.RoundedElementBounds().width()); |
| 164 } | 164 } |
| 165 | 165 |
| 166 void PasswordGenerationPopupControllerImpl::CalculateBounds() { | 166 void PasswordGenerationPopupControllerImpl::CalculateBounds() { |
| 167 gfx::Size bounds = view_->GetPreferredSizeOfPasswordView(); | 167 gfx::Size bounds = view_->GetPreferredSizeOfPasswordView(); |
| 168 | 168 |
| 169 popup_bounds_ = controller_common_.GetPopupBounds(bounds.width(), | 169 popup_bounds_ = controller_common_.GetPopupBounds(bounds.width(), |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 | 264 |
| 265 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { | 265 const base::string16& PasswordGenerationPopupControllerImpl::HelpText() { |
| 266 return help_text_; | 266 return help_text_; |
| 267 } | 267 } |
| 268 | 268 |
| 269 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { | 269 const gfx::Range& PasswordGenerationPopupControllerImpl::HelpTextLinkRange() { |
| 270 return link_range_; | 270 return link_range_; |
| 271 } | 271 } |
| 272 | 272 |
| 273 } // namespace autofill | 273 } // namespace autofill |
| OLD | NEW |