Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/password_generation_agent.h" | 5 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "components/autofill/content/common/autofill_messages.h" | 10 #include "components/autofill/content/common/autofill_messages.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 // Password isn't generated and there are fewer than kMaximumOfferSize | 404 // Password isn't generated and there are fewer than kMaximumOfferSize |
| 405 // characters typed, so keep offering the password. Note this function | 405 // characters typed, so keep offering the password. Note this function |
| 406 // will just keep the previous popup if one is already showing. | 406 // will just keep the previous popup if one is already showing. |
| 407 ShowGenerationPopup(); | 407 ShowGenerationPopup(); |
| 408 } | 408 } |
| 409 | 409 |
| 410 return true; | 410 return true; |
| 411 } | 411 } |
| 412 | 412 |
| 413 void PasswordGenerationAgent::ShowGenerationPopup() { | 413 void PasswordGenerationAgent::ShowGenerationPopup() { |
| 414 gfx::RectF bounding_box_scaled = form_util::GetScaledBoundingBox( | 414 blink::WebRect bounding_box_in_viewport = |
|
vabr (Chromium)
2015/11/24 09:12:27
ditto
oshima
2015/11/24 23:42:10
Done.
| |
| 415 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(), | 415 generation_element_.boundsInViewport(); |
| 416 &generation_element_); | |
| 417 | 416 |
| 418 Send(new AutofillHostMsg_ShowPasswordGenerationPopup( | 417 Send(new AutofillHostMsg_ShowPasswordGenerationPopup( |
| 419 routing_id(), | 418 routing_id(), gfx::RectF(bounding_box_in_viewport), |
| 420 bounding_box_scaled, | 419 generation_element_.maxLength(), *generation_form_data_->form)); |
| 421 generation_element_.maxLength(), | |
| 422 *generation_form_data_->form)); | |
| 423 | 420 |
| 424 generation_popup_shown_ = true; | 421 generation_popup_shown_ = true; |
| 425 } | 422 } |
| 426 | 423 |
| 427 void PasswordGenerationAgent::ShowEditingPopup() { | 424 void PasswordGenerationAgent::ShowEditingPopup() { |
| 428 gfx::RectF bounding_box_scaled = form_util::GetScaledBoundingBox( | 425 blink::WebRect bounding_box_in_viewport = |
|
vabr (Chromium)
2015/11/24 09:12:27
ditto
oshima
2015/11/24 23:42:10
Done.
| |
| 429 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(), | 426 generation_element_.boundsInViewport(); |
| 430 &generation_element_); | |
| 431 | 427 |
| 432 Send(new AutofillHostMsg_ShowPasswordEditingPopup( | 428 Send(new AutofillHostMsg_ShowPasswordEditingPopup( |
| 433 routing_id(), | 429 routing_id(), gfx::RectF(bounding_box_in_viewport), |
| 434 bounding_box_scaled, | |
| 435 *generation_form_data_->form)); | 430 *generation_form_data_->form)); |
| 436 | 431 |
| 437 editing_popup_shown_ = true; | 432 editing_popup_shown_ = true; |
| 438 } | 433 } |
| 439 | 434 |
| 440 void PasswordGenerationAgent::HidePopup() { | 435 void PasswordGenerationAgent::HidePopup() { |
| 441 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); | 436 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); |
| 442 } | 437 } |
| 443 | 438 |
| 444 } // namespace autofill | 439 } // namespace autofill |
| OLD | NEW |