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

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

Issue 2661743002: PlzNavigate: Invoke didStartProvisionalLoad() when the renderer initiates a navigation in startLoad( (Closed)
Patch Set: Remove CHECK for redirect chain as the redirects may not be populated for provisional loads for ren… 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
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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 } else if (logger) { 1160 } else if (logger) {
1161 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD); 1161 logger->LogMessage(Logger::STRING_FORM_IS_NOT_PASSWORD);
1162 } 1162 }
1163 } 1163 }
1164 1164
1165 void PasswordAutofillAgent::OnDestruct() { 1165 void PasswordAutofillAgent::OnDestruct() {
1166 binding_.Close(); 1166 binding_.Close();
1167 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this); 1167 base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
1168 } 1168 }
1169 1169
1170 void PasswordAutofillAgent::DidStartProvisionalLoad() { 1170 void PasswordAutofillAgent::DidStartProvisionalLoad(
1171 blink::WebDataSource* data_source) {
1171 std::unique_ptr<RendererSavePasswordProgressLogger> logger; 1172 std::unique_ptr<RendererSavePasswordProgressLogger> logger;
1172 if (logging_state_active_) { 1173 if (logging_state_active_) {
1173 logger.reset(new RendererSavePasswordProgressLogger( 1174 logger.reset(new RendererSavePasswordProgressLogger(
1174 GetPasswordManagerDriver().get())); 1175 GetPasswordManagerDriver().get()));
1175 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD); 1176 logger->LogMessage(Logger::STRING_DID_START_PROVISIONAL_LOAD_METHOD);
1176 } 1177 }
1177 1178
1178 const blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame(); 1179 const blink::WebLocalFrame* navigated_frame = render_frame()->GetWebFrame();
1179 if (navigated_frame->parent()) { 1180 if (navigated_frame->parent()) {
1180 if (logger) 1181 if (logger)
1181 logger->LogMessage(Logger::STRING_FRAME_NOT_MAIN_FRAME); 1182 logger->LogMessage(Logger::STRING_FRAME_NOT_MAIN_FRAME);
1182 return; 1183 return;
1183 } 1184 }
1184 1185
1185 // Bug fix for crbug.com/368690. isProcessingUserGesture() is false when 1186 // Bug fix for crbug.com/368690. isProcessingUserGesture() is false when
1186 // the user is performing actions outside the page (e.g. typed url, 1187 // the user is performing actions outside the page (e.g. typed url,
1187 // history navigation). We don't want to trigger saving in these cases. 1188 // history navigation). We don't want to trigger saving in these cases.
1188 content::DocumentState* document_state = 1189 content::DocumentState* document_state =
1189 content::DocumentState::FromDataSource( 1190 content::DocumentState::FromDataSource(data_source);
1190 navigated_frame->provisionalDataSource());
1191 content::NavigationState* navigation_state = 1191 content::NavigationState* navigation_state =
1192 document_state->navigation_state(); 1192 document_state->navigation_state();
1193 ui::PageTransition type = navigation_state->GetTransitionType(); 1193 ui::PageTransition type = navigation_state->GetTransitionType();
1194 if (ui::PageTransitionIsWebTriggerable(type) && 1194 if (ui::PageTransitionIsWebTriggerable(type) &&
1195 ui::PageTransitionIsNewNavigation(type) && 1195 ui::PageTransitionIsNewNavigation(type) &&
1196 !blink::WebUserGestureIndicator::isProcessingUserGesture()) { 1196 !blink::WebUserGestureIndicator::isProcessingUserGesture()) {
1197 // If onsubmit has been called, try and save that form. 1197 // If onsubmit has been called, try and save that form.
1198 if (provisionally_saved_form_) { 1198 if (provisionally_saved_form_) {
1199 if (logger) { 1199 if (logger) {
1200 logger->LogPasswordForm( 1200 logger->LogPasswordForm(
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after
1517 PasswordAutofillAgent::GetPasswordManagerDriver() { 1517 PasswordAutofillAgent::GetPasswordManagerDriver() {
1518 if (!password_manager_driver_) { 1518 if (!password_manager_driver_) {
1519 render_frame()->GetRemoteInterfaces()->GetInterface( 1519 render_frame()->GetRemoteInterfaces()->GetInterface(
1520 mojo::MakeRequest(&password_manager_driver_)); 1520 mojo::MakeRequest(&password_manager_driver_));
1521 } 1521 }
1522 1522
1523 return password_manager_driver_; 1523 return password_manager_driver_;
1524 } 1524 }
1525 1525
1526 } // namespace autofill 1526 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698