| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 #include "content/public/browser/navigation_handle.h" | 58 #include "content/public/browser/navigation_handle.h" |
| 59 #include "content/public/browser/render_view_host.h" | 59 #include "content/public/browser/render_view_host.h" |
| 60 #include "content/public/browser/ssl_status.h" | 60 #include "content/public/browser/ssl_status.h" |
| 61 #include "content/public/browser/web_contents.h" | 61 #include "content/public/browser/web_contents.h" |
| 62 #include "content/public/common/origin_util.h" | 62 #include "content/public/common/origin_util.h" |
| 63 #include "extensions/features/features.h" | 63 #include "extensions/features/features.h" |
| 64 #include "google_apis/gaia/gaia_urls.h" | 64 #include "google_apis/gaia/gaia_urls.h" |
| 65 #include "net/base/url_util.h" | 65 #include "net/base/url_util.h" |
| 66 #include "third_party/re2/src/re2/re2.h" | 66 #include "third_party/re2/src/re2/re2.h" |
| 67 | 67 |
| 68 #if defined(SAFE_BROWSING_DB_LOCAL) || defined(SAFE_BROWSING_DB_REMOTE) | 68 #if defined(SAFE_BROWSING_DB_LOCAL) |
| 69 #include "chrome/browser/browser_process.h" | 69 #include "chrome/browser/browser_process.h" |
| 70 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 70 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 71 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" | 71 #include "components/safe_browsing/password_protection/password_protection_servi
ce.h" |
| 72 #endif | 72 #endif |
| 73 | 73 |
| 74 #if defined(OS_ANDROID) | 74 #if defined(OS_ANDROID) |
| 75 #include "chrome/browser/android/tab_android.h" | 75 #include "chrome/browser/android/tab_android.h" |
| 76 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" | 76 #include "chrome/browser/password_manager/account_chooser_dialog_android.h" |
| 77 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h
" | 77 #include "chrome/browser/password_manager/auto_signin_first_run_dialog_android.h
" |
| 78 #include "chrome/browser/password_manager/generated_password_saved_infobar_deleg
ate_android.h" | 78 #include "chrome/browser/password_manager/generated_password_saved_infobar_deleg
ate_android.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 | 403 |
| 404 #if defined(SAFE_BROWSING_DB_LOCAL) | 404 #if defined(SAFE_BROWSING_DB_LOCAL) |
| 405 safe_browsing::PasswordProtectionService* | 405 safe_browsing::PasswordProtectionService* |
| 406 ChromePasswordManagerClient::GetPasswordProtectionService() const { | 406 ChromePasswordManagerClient::GetPasswordProtectionService() const { |
| 407 if (g_browser_process && g_browser_process->safe_browsing_service()) { | 407 if (g_browser_process && g_browser_process->safe_browsing_service()) { |
| 408 return g_browser_process->safe_browsing_service() | 408 return g_browser_process->safe_browsing_service() |
| 409 ->GetPasswordProtectionService(profile_); | 409 ->GetPasswordProtectionService(profile_); |
| 410 } | 410 } |
| 411 return nullptr; | 411 return nullptr; |
| 412 } | 412 } |
| 413 |
| 414 void ChromePasswordManagerClient::CheckSafeBrowsingReputation( |
| 415 const GURL& form_action, |
| 416 const GURL& frame_url) { |
| 417 safe_browsing::PasswordProtectionService* pps = |
| 418 GetPasswordProtectionService(); |
| 419 if (pps) { |
| 420 pps->MaybeStartLowReputationRequest(GetMainFrameURL(), form_action, |
| 421 frame_url); |
| 422 } |
| 423 } |
| 413 #endif | 424 #endif |
| 414 | 425 |
| 415 // TODO(crbug.com/706392): Fix password reuse detection for Android. | 426 // TODO(crbug.com/706392): Fix password reuse detection for Android. |
| 416 #if !defined(OS_ANDROID) | 427 #if !defined(OS_ANDROID) |
| 417 void ChromePasswordManagerClient::DidFinishNavigation( | 428 void ChromePasswordManagerClient::DidFinishNavigation( |
| 418 content::NavigationHandle* navigation_handle) { | 429 content::NavigationHandle* navigation_handle) { |
| 419 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) | 430 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
| 420 return; | 431 return; |
| 421 | 432 |
| 422 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); | 433 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 // static | 701 // static |
| 691 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { | 702 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { |
| 692 std::string scheme = url.scheme(); | 703 std::string scheme = url.scheme(); |
| 693 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( | 704 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( |
| 694 scheme) && | 705 scheme) && |
| 695 #if BUILDFLAG(ENABLE_EXTENSIONS) | 706 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 696 scheme != extensions::kExtensionScheme && | 707 scheme != extensions::kExtensionScheme && |
| 697 #endif | 708 #endif |
| 698 scheme != content::kChromeDevToolsScheme); | 709 scheme != content::kChromeDevToolsScheme); |
| 699 } | 710 } |
| OLD | NEW |