| 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 |
| 422 // that web_content can be used to display safe browsing interstitial. |
| 421 pps->MaybeStartPasswordFieldOnFocusRequest(GetMainFrameURL(), form_action, | 423 pps->MaybeStartPasswordFieldOnFocusRequest(GetMainFrameURL(), form_action, |
| 422 frame_url); | 424 frame_url); |
| 423 } | 425 } |
| 424 } | 426 } |
| 427 |
| 428 void ChromePasswordManagerClient::CheckProtectedPasswordEntry( |
| 429 const std::string& password_saved_domain) { |
| 430 safe_browsing::PasswordProtectionService* pps = |
| 431 GetPasswordProtectionService(); |
| 432 if (pps) { |
| 433 // TODO(jialiul): Pass in web_content() instead of GetMainFrameURL(), such |
| 434 // that web_content can be used to display safe browsing interstitial. |
| 435 pps->MaybeStartProtectedPasswordEntryRequest(GetMainFrameURL(), |
| 436 password_saved_domain); |
| 437 } |
| 438 } |
| 425 #endif | 439 #endif |
| 426 | 440 |
| 427 // TODO(crbug.com/706392): Fix password reuse detection for Android. | 441 // TODO(crbug.com/706392): Fix password reuse detection for Android. |
| 428 #if !defined(OS_ANDROID) | 442 #if !defined(OS_ANDROID) |
| 429 void ChromePasswordManagerClient::DidFinishNavigation( | 443 void ChromePasswordManagerClient::DidFinishNavigation( |
| 430 content::NavigationHandle* navigation_handle) { | 444 content::NavigationHandle* navigation_handle) { |
| 431 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 445 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
| 432 return; | 446 return; |
| 433 | 447 |
| 434 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); | 448 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 703 // static | 717 // static |
| 704 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { | 718 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { |
| 705 std::string scheme = url.scheme(); | 719 std::string scheme = url.scheme(); |
| 706 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( | 720 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( |
| 707 scheme) && | 721 scheme) && |
| 708 #if BUILDFLAG(ENABLE_EXTENSIONS) | 722 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 709 scheme != extensions::kExtensionScheme && | 723 scheme != extensions::kExtensionScheme && |
| 710 #endif | 724 #endif |
| 711 scheme != content::kChromeDevToolsScheme); | 725 scheme != content::kChromeDevToolsScheme); |
| 712 } | 726 } |
| OLD | NEW |