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

Unified Diff: components/autofill/content/browser/content_autofill_driver.cc

Issue 2664193005: [merge m57][autofill] Verify widget view is valid before using it. (Closed)
Patch Set: Created 3 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/content/browser/content_autofill_driver.cc
diff --git a/components/autofill/content/browser/content_autofill_driver.cc b/components/autofill/content/browser/content_autofill_driver.cc
index 2449d6c69d0911e6e357dbeaad10f209b1347bc9..8eb8de071aecbdb8444f5b52908e1f4cdf69cacb 100644
--- a/components/autofill/content/browser/content_autofill_driver.cc
+++ b/components/autofill/content/browser/content_autofill_driver.cc
@@ -159,15 +159,15 @@ void ContentAutofillDriver::PopupHidden() {
gfx::RectF ContentAutofillDriver::TransformBoundingBoxToViewportCoordinates(
const gfx::RectF& bounding_box) {
+ content::RenderWidgetHostView* view = render_frame_host_->GetView();
+ if (!view)
+ return bounding_box;
+
gfx::Point orig_point(bounding_box.x(), bounding_box.y());
- gfx::Point transformed_point;
- transformed_point =
- render_frame_host_->GetView()->TransformPointToRootCoordSpace(orig_point);
-
- gfx::RectF new_box;
- new_box.SetRect(transformed_point.x(), transformed_point.y(),
- bounding_box.width(), bounding_box.height());
- return new_box;
+ gfx::Point transformed_point =
+ view->TransformPointToRootCoordSpace(orig_point);
+ return gfx::RectF(transformed_point.x(), transformed_point.y(),
+ bounding_box.width(), bounding_box.height());
}
void ContentAutofillDriver::DidInteractWithCreditCardForm() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698