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

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

Issue 1371673002: Remove a bunch of provisionalDataSource() usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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_autofill_agent.h" 5 #include "components/autofill/content/renderer/password_autofill_agent.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 // RenderView to be instantiated (such as redirects to the WebStore) 1225 // RenderView to be instantiated (such as redirects to the WebStore)
1226 // we will never get to finish the load. 1226 // we will never get to finish the load.
1227 Send(new AutofillHostMsg_PasswordFormSubmitted(routing_id(), 1227 Send(new AutofillHostMsg_PasswordFormSubmitted(routing_id(),
1228 *submitted_form)); 1228 *submitted_form));
1229 provisionally_saved_form_.reset(); 1229 provisionally_saved_form_.reset();
1230 } else if (logger) { 1230 } else if (logger) {
1231 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD); 1231 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD);
1232 } 1232 }
1233 } 1233 }
1234 1234
1235 void PasswordAutofillAgent::LegacyDidStartProvisionalLoad( 1235 void PasswordAutofillAgent::DidStartProvisionalLoad(
1236 blink::WebLocalFrame* navigated_frame) { 1236 blink::WebDataSource* datasource) {
1237 scoped_ptr<RendererSavePasswordProgressLogger> logger; 1237 scoped_ptr<RendererSavePasswordProgressLogger> logger;
1238 if (logging_state_active_) { 1238 if (logging_state_active_) {
1239 logger.reset(new RendererSavePasswordProgressLogger(this, routing_id())); 1239 logger.reset(new RendererSavePasswordProgressLogger(this, routing_id()));
1240 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD); 1240 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD);
1241 } 1241 }
1242 1242
1243 if (navigated_frame->parent()) { 1243 if (render_frame()->GetWebFrame()->parent()) {
1244 if (logger) 1244 if (logger)
1245 logger->LogMessage(Logger::STRING_FRAME_NOT_MAIN_FRAME); 1245 logger->LogMessage(Logger::STRING_FRAME_NOT_MAIN_FRAME);
1246 return; 1246 return;
1247 } 1247 }
1248 1248
1249 // Bug fix for crbug.com/368690. isProcessingUserGesture() is false when 1249 // Bug fix for crbug.com/368690. isProcessingUserGesture() is false when
1250 // the user is performing actions outside the page (e.g. typed url, 1250 // the user is performing actions outside the page (e.g. typed url,
1251 // history navigation). We don't want to trigger saving in these cases. 1251 // history navigation). We don't want to trigger saving in these cases.
1252 content::DocumentState* document_state = 1252 content::DocumentState* document_state =
1253 content::DocumentState::FromDataSource( 1253 content::DocumentState::FromDataSource(datasource);
1254 navigated_frame->provisionalDataSource());
1255 content::NavigationState* navigation_state = 1254 content::NavigationState* navigation_state =
1256 document_state->navigation_state(); 1255 document_state->navigation_state();
1257 ui::PageTransition type = navigation_state->GetTransitionType(); 1256 ui::PageTransition type = navigation_state->GetTransitionType();
1258 if (ui::PageTransitionIsWebTriggerable(type) && 1257 if (ui::PageTransitionIsWebTriggerable(type) &&
1259 ui::PageTransitionIsNewNavigation(type) && 1258 ui::PageTransitionIsNewNavigation(type) &&
1260 !blink::WebUserGestureIndicator::isProcessingUserGesture()) { 1259 !blink::WebUserGestureIndicator::isProcessingUserGesture()) {
1261 // If onsubmit has been called, try and save that form. 1260 // If onsubmit has been called, try and save that form.
1262 if (provisionally_saved_form_) { 1261 if (provisionally_saved_form_) {
1263 if (logger) { 1262 if (logger) {
1264 logger->LogPasswordForm( 1263 logger->LogPasswordForm(
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1562 } 1561 }
1563 1562
1564 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStartLoading() { 1563 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStartLoading() {
1565 agent_->DidStartLoading(); 1564 agent_->DidStartLoading();
1566 } 1565 }
1567 1566
1568 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { 1567 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() {
1569 agent_->DidStopLoading(); 1568 agent_->DidStopLoading();
1570 } 1569 }
1571 1570
1572 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::
1573 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) {
1574 agent_->LegacyDidStartProvisionalLoad(navigated_frame);
1575 }
1576
1577 } // namespace autofill 1571 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698