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

Side by Side Diff: components/password_manager/content/browser/content_password_manager_driver.cc

Issue 2680463002: Convert ContentPasswordManagerDriver to use the new navigation callbacks. (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
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/password_manager/content/browser/content_password_manager_d river.h" 5 #include "components/password_manager/content/browser/content_password_manager_d river.h"
6 6
7 #include "components/autofill/content/browser/content_autofill_driver.h" 7 #include "components/autofill/content/browser/content_autofill_driver.h"
8 #include "components/autofill/core/common/form_data.h" 8 #include "components/autofill/core/common/form_data.h"
9 #include "components/autofill/core/common/password_form.h" 9 #include "components/autofill/core/common/password_form.h"
10 #include "components/password_manager/content/browser/bad_message.h" 10 #include "components/password_manager/content/browser/bad_message.h"
11 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h" 11 #include "components/password_manager/content/browser/content_password_manager_d river_factory.h"
12 #include "components/password_manager/content/browser/visible_password_observer. h" 12 #include "components/password_manager/content/browser/visible_password_observer. h"
13 #include "components/password_manager/core/browser/log_manager.h" 13 #include "components/password_manager/core/browser/log_manager.h"
14 #include "components/password_manager/core/browser/password_manager.h" 14 #include "components/password_manager/core/browser/password_manager.h"
15 #include "components/password_manager/core/browser/password_manager_client.h" 15 #include "components/password_manager/core/browser/password_manager_client.h"
16 #include "content/public/browser/browser_context.h" 16 #include "content/public/browser/browser_context.h"
17 #include "content/public/browser/child_process_security_policy.h" 17 #include "content/public/browser/child_process_security_policy.h"
18 #include "content/public/browser/navigation_details.h"
19 #include "content/public/browser/navigation_entry.h" 18 #include "content/public/browser/navigation_entry.h"
19 #include "content/public/browser/navigation_handle.h"
20 #include "content/public/browser/render_frame_host.h" 20 #include "content/public/browser/render_frame_host.h"
21 #include "content/public/browser/render_process_host.h" 21 #include "content/public/browser/render_process_host.h"
22 #include "content/public/browser/render_view_host.h" 22 #include "content/public/browser/render_view_host.h"
23 #include "content/public/browser/site_instance.h" 23 #include "content/public/browser/site_instance.h"
24 #include "content/public/browser/ssl_status.h" 24 #include "content/public/browser/ssl_status.h"
25 #include "content/public/browser/web_contents.h" 25 #include "content/public/browser/web_contents.h"
26 #include "net/cert/cert_status_flags.h" 26 #include "net/cert/cert_status_flags.h"
27 #include "services/service_manager/public/cpp/interface_provider.h" 27 #include "services/service_manager/public/cpp/interface_provider.h"
28 28
29 namespace password_manager { 29 namespace password_manager {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 } 207 }
208 208
209 void ContentPasswordManagerDriver:: 209 void ContentPasswordManagerDriver::
210 AllPasswordFieldsInInsecureContextInvisible() { 210 AllPasswordFieldsInInsecureContextInvisible() {
211 VisiblePasswordObserver* observer = VisiblePasswordObserver::FromWebContents( 211 VisiblePasswordObserver* observer = VisiblePasswordObserver::FromWebContents(
212 content::WebContents::FromRenderFrameHost(render_frame_host_)); 212 content::WebContents::FromRenderFrameHost(render_frame_host_));
213 observer->RenderFrameHasNoVisiblePasswordFields(render_frame_host_); 213 observer->RenderFrameHasNoVisiblePasswordFields(render_frame_host_);
214 } 214 }
215 215
216 void ContentPasswordManagerDriver::DidNavigateFrame( 216 void ContentPasswordManagerDriver::DidNavigateFrame(
217 const content::LoadCommittedDetails& details, 217 content::NavigationHandle* navigation_handle) {
218 const content::FrameNavigateParams& params) {
219 // Clear page specific data after main frame navigation. 218 // Clear page specific data after main frame navigation.
220 if (!render_frame_host_->GetParent() && !details.is_in_page) { 219 if (navigation_handle->IsInMainFrame() && !navigation_handle->IsSamePage()) {
221 GetPasswordManager()->DidNavigateMainFrame(); 220 GetPasswordManager()->DidNavigateMainFrame();
222 GetPasswordAutofillManager()->DidNavigateMainFrame(); 221 GetPasswordAutofillManager()->DidNavigateMainFrame();
223 } 222 }
224 } 223 }
225 224
226 void ContentPasswordManagerDriver::InPageNavigation( 225 void ContentPasswordManagerDriver::InPageNavigation(
227 const autofill::PasswordForm& password_form) { 226 const autofill::PasswordForm& password_form) {
228 if (!CheckChildProcessSecurityPolicy( 227 if (!CheckChildProcessSecurityPolicy(
229 password_form.origin, 228 password_form.origin,
230 BadMessageReason::CPMD_BAD_ORIGIN_IN_PAGE_NAVIGATION)) 229 BadMessageReason::CPMD_BAD_ORIGIN_IN_PAGE_NAVIGATION))
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 ContentPasswordManagerDriver::GetPasswordGenerationAgent() { 329 ContentPasswordManagerDriver::GetPasswordGenerationAgent() {
331 if (!password_gen_agent_) { 330 if (!password_gen_agent_) {
332 render_frame_host_->GetRemoteInterfaces()->GetInterface( 331 render_frame_host_->GetRemoteInterfaces()->GetInterface(
333 mojo::MakeRequest(&password_gen_agent_)); 332 mojo::MakeRequest(&password_gen_agent_));
334 } 333 }
335 334
336 return password_gen_agent_; 335 return password_gen_agent_;
337 } 336 }
338 337
339 } // namespace password_manager 338 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698