OLD | NEW |
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 "chrome/browser/password_manager/chrome_password_manager_client.h" | 5 #include "chrome/browser/password_manager/chrome_password_manager_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 } | 411 } |
412 return nullptr; | 412 return nullptr; |
413 } | 413 } |
414 | 414 |
415 void ChromePasswordManagerClient::CheckSafeBrowsingReputation( | 415 void ChromePasswordManagerClient::CheckSafeBrowsingReputation( |
416 const GURL& form_action, | 416 const GURL& form_action, |
417 const GURL& frame_url) { | 417 const GURL& frame_url) { |
418 safe_browsing::PasswordProtectionService* pps = | 418 safe_browsing::PasswordProtectionService* pps = |
419 GetPasswordProtectionService(); | 419 GetPasswordProtectionService(); |
420 if (pps) { | 420 if (pps) { |
421 // TODO(jialiul): Pass in web_content() instead of GetMainFrameURL(), such | 421 pps->MaybeStartPasswordFieldOnFocusRequest( |
422 // that web_content can be used to display safe browsing interstitial. | 422 web_contents(), GetMainFrameURL(), form_action, frame_url); |
423 pps->MaybeStartPasswordFieldOnFocusRequest(GetMainFrameURL(), form_action, | |
424 frame_url); | |
425 } | 423 } |
426 } | 424 } |
427 | 425 |
428 void ChromePasswordManagerClient::CheckProtectedPasswordEntry( | 426 void ChromePasswordManagerClient::CheckProtectedPasswordEntry( |
429 const std::string& password_saved_domain) { | 427 const std::string& password_saved_domain) { |
430 safe_browsing::PasswordProtectionService* pps = | 428 safe_browsing::PasswordProtectionService* pps = |
431 GetPasswordProtectionService(); | 429 GetPasswordProtectionService(); |
432 if (pps) { | 430 if (pps) { |
433 // TODO(jialiul): Pass in web_content() instead of GetMainFrameURL(), such | 431 pps->MaybeStartProtectedPasswordEntryRequest( |
434 // that web_content can be used to display safe browsing interstitial. | 432 web_contents(), GetMainFrameURL(), password_saved_domain); |
435 pps->MaybeStartProtectedPasswordEntryRequest(GetMainFrameURL(), | |
436 password_saved_domain); | |
437 } | 433 } |
438 } | 434 } |
439 #endif | 435 #endif |
440 | 436 |
441 // TODO(crbug.com/706392): Fix password reuse detection for Android. | 437 // TODO(crbug.com/706392): Fix password reuse detection for Android. |
442 #if !defined(OS_ANDROID) | 438 #if !defined(OS_ANDROID) |
443 void ChromePasswordManagerClient::DidFinishNavigation( | 439 void ChromePasswordManagerClient::DidFinishNavigation( |
444 content::NavigationHandle* navigation_handle) { | 440 content::NavigationHandle* navigation_handle) { |
445 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 441 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
446 return; | 442 return; |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // static | 713 // static |
718 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { | 714 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { |
719 std::string scheme = url.scheme(); | 715 std::string scheme = url.scheme(); |
720 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( | 716 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( |
721 scheme) && | 717 scheme) && |
722 #if BUILDFLAG(ENABLE_EXTENSIONS) | 718 #if BUILDFLAG(ENABLE_EXTENSIONS) |
723 scheme != extensions::kExtensionScheme && | 719 scheme != extensions::kExtensionScheme && |
724 #endif | 720 #endif |
725 scheme != content::kChromeDevToolsScheme); | 721 scheme != content::kChromeDevToolsScheme); |
726 } | 722 } |
OLD | NEW |