Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(370)

Side by Side Diff: components/autofill/content/renderer/password_generation_agent.cc

Issue 1463723003: Return VisualViewport coords in boundsInViewportSpace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(
415 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(),
416 &generation_element_);
417
418 Send(new AutofillHostMsg_ShowPasswordGenerationPopup( 414 Send(new AutofillHostMsg_ShowPasswordGenerationPopup(
419 routing_id(), 415 routing_id(), gfx::RectF(generation_element_.boundsInViewport()),
420 bounding_box_scaled, 416 generation_element_.maxLength(), *generation_form_data_->form));
421 generation_element_.maxLength(),
422 *generation_form_data_->form));
423 417
424 generation_popup_shown_ = true; 418 generation_popup_shown_ = true;
425 } 419 }
426 420
427 void PasswordGenerationAgent::ShowEditingPopup() { 421 void PasswordGenerationAgent::ShowEditingPopup() {
428 gfx::RectF bounding_box_scaled = form_util::GetScaledBoundingBox(
429 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(),
430 &generation_element_);
431
432 Send(new AutofillHostMsg_ShowPasswordEditingPopup( 422 Send(new AutofillHostMsg_ShowPasswordEditingPopup(
433 routing_id(), 423 routing_id(), gfx::RectF(generation_element_.boundsInViewport()),
434 bounding_box_scaled,
435 *generation_form_data_->form)); 424 *generation_form_data_->form));
436 425
437 editing_popup_shown_ = true; 426 editing_popup_shown_ = true;
438 } 427 }
439 428
440 void PasswordGenerationAgent::HidePopup() { 429 void PasswordGenerationAgent::HidePopup() {
441 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id())); 430 Send(new AutofillHostMsg_HidePasswordGenerationPopup(routing_id()));
442 } 431 }
443 432
444 } // namespace autofill 433 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698