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

Side by Side 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, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "components/autofill/content/browser/content_autofill_driver.h" 5 #include "components/autofill/content/browser/content_autofill_driver.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 152
153 void ContentAutofillDriver::PopupHidden() { 153 void ContentAutofillDriver::PopupHidden() {
154 // If the unmask prompt is showing, keep showing the preview. The preview 154 // If the unmask prompt is showing, keep showing the preview. The preview
155 // will be cleared when the prompt closes. 155 // will be cleared when the prompt closes.
156 if (!autofill_manager_->IsShowingUnmaskPrompt()) 156 if (!autofill_manager_->IsShowingUnmaskPrompt())
157 RendererShouldClearPreviewedForm(); 157 RendererShouldClearPreviewedForm();
158 } 158 }
159 159
160 gfx::RectF ContentAutofillDriver::TransformBoundingBoxToViewportCoordinates( 160 gfx::RectF ContentAutofillDriver::TransformBoundingBoxToViewportCoordinates(
161 const gfx::RectF& bounding_box) { 161 const gfx::RectF& bounding_box) {
162 content::RenderWidgetHostView* view = render_frame_host_->GetView();
163 if (!view)
164 return bounding_box;
165
162 gfx::Point orig_point(bounding_box.x(), bounding_box.y()); 166 gfx::Point orig_point(bounding_box.x(), bounding_box.y());
163 gfx::Point transformed_point; 167 gfx::Point transformed_point =
164 transformed_point = 168 view->TransformPointToRootCoordSpace(orig_point);
165 render_frame_host_->GetView()->TransformPointToRootCoordSpace(orig_point); 169 return gfx::RectF(transformed_point.x(), transformed_point.y(),
166 170 bounding_box.width(), bounding_box.height());
167 gfx::RectF new_box;
168 new_box.SetRect(transformed_point.x(), transformed_point.y(),
169 bounding_box.width(), bounding_box.height());
170 return new_box;
171 } 171 }
172 172
173 void ContentAutofillDriver::DidInteractWithCreditCardForm() { 173 void ContentAutofillDriver::DidInteractWithCreditCardForm() {
174 // Notify the WebContents about credit card inputs on HTTP pages. 174 // Notify the WebContents about credit card inputs on HTTP pages.
175 content::WebContents* contents = 175 content::WebContents* contents =
176 content::WebContents::FromRenderFrameHost(render_frame_host_); 176 content::WebContents::FromRenderFrameHost(render_frame_host_);
177 if (contents->GetVisibleURL().SchemeIsCryptographic()) 177 if (contents->GetVisibleURL().SchemeIsCryptographic())
178 return; 178 return;
179 contents->OnCreditCardInputShownOnHttp(); 179 contents->OnCreditCardInputShownOnHttp();
180 } 180 }
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 // Here is a lazy binding, and will not reconnect after connection error. 260 // Here is a lazy binding, and will not reconnect after connection error.
261 if (!autofill_agent_) { 261 if (!autofill_agent_) {
262 render_frame_host_->GetRemoteInterfaces()->GetInterface( 262 render_frame_host_->GetRemoteInterfaces()->GetInterface(
263 mojo::MakeRequest(&autofill_agent_)); 263 mojo::MakeRequest(&autofill_agent_));
264 } 264 }
265 265
266 return autofill_agent_; 266 return autofill_agent_;
267 } 267 }
268 268
269 } // namespace autofill 269 } // namespace autofill
OLDNEW
« 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