| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 #include "components/password_manager/core/common/credential_manager_types.h" | 45 #include "components/password_manager/core/common/credential_manager_types.h" |
| 46 #include "components/password_manager/core/common/password_manager_features.h" | 46 #include "components/password_manager/core/common/password_manager_features.h" |
| 47 #include "components/password_manager/core/common/password_manager_pref_names.h" | 47 #include "components/password_manager/core/common/password_manager_pref_names.h" |
| 48 #include "components/password_manager/sync/browser/password_sync_util.h" | 48 #include "components/password_manager/sync/browser/password_sync_util.h" |
| 49 #include "components/prefs/pref_service.h" | 49 #include "components/prefs/pref_service.h" |
| 50 #include "components/sessions/content/content_record_password_state.h" | 50 #include "components/sessions/content/content_record_password_state.h" |
| 51 #include "components/signin/core/browser/signin_manager.h" | 51 #include "components/signin/core/browser/signin_manager.h" |
| 52 #include "components/version_info/version_info.h" | 52 #include "components/version_info/version_info.h" |
| 53 #include "content/public/browser/child_process_security_policy.h" | 53 #include "content/public/browser/child_process_security_policy.h" |
| 54 #include "content/public/browser/navigation_entry.h" | 54 #include "content/public/browser/navigation_entry.h" |
| 55 #include "content/public/browser/navigation_handle.h" |
| 55 #include "content/public/browser/render_view_host.h" | 56 #include "content/public/browser/render_view_host.h" |
| 56 #include "content/public/browser/ssl_status.h" | 57 #include "content/public/browser/ssl_status.h" |
| 57 #include "content/public/browser/web_contents.h" | 58 #include "content/public/browser/web_contents.h" |
| 58 #include "extensions/features/features.h" | 59 #include "extensions/features/features.h" |
| 59 #include "google_apis/gaia/gaia_urls.h" | 60 #include "google_apis/gaia/gaia_urls.h" |
| 60 #include "net/base/url_util.h" | 61 #include "net/base/url_util.h" |
| 61 #include "third_party/re2/src/re2/re2.h" | 62 #include "third_party/re2/src/re2/re2.h" |
| 62 | 63 |
| 63 #if defined(OS_ANDROID) | 64 #if defined(OS_ANDROID) |
| 64 #include "chrome/browser/android/tab_android.h" | 65 #include "chrome/browser/android/tab_android.h" |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 manage_passwords_ui_controller->OnPasswordAutofilled(best_matches, origin, | 375 manage_passwords_ui_controller->OnPasswordAutofilled(best_matches, origin, |
| 375 federated_matches); | 376 federated_matches); |
| 376 #endif | 377 #endif |
| 377 } | 378 } |
| 378 | 379 |
| 379 void ChromePasswordManagerClient::HidePasswordGenerationPopup() { | 380 void ChromePasswordManagerClient::HidePasswordGenerationPopup() { |
| 380 if (popup_controller_) | 381 if (popup_controller_) |
| 381 popup_controller_->HideAndDestroy(); | 382 popup_controller_->HideAndDestroy(); |
| 382 } | 383 } |
| 383 | 384 |
| 384 void ChromePasswordManagerClient::DidNavigateMainFrame( | 385 void ChromePasswordManagerClient::DidFinishNavigation( |
| 385 const content::LoadCommittedDetails& details, | 386 content::NavigationHandle* navigation_handle) { |
| 386 const content::FrameNavigateParams& params) { | 387 if (!navigation_handle->IsInMainFrame() || !navigation_handle->HasCommitted()) |
| 388 return; |
| 389 |
| 387 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); | 390 password_reuse_detection_manager_.DidNavigateMainFrame(GetMainFrameURL()); |
| 388 // After some navigations RenderViewHost persists and just adding the observer | 391 // After some navigations RenderViewHost persists and just adding the observer |
| 389 // will cause multiple call of OnInputEvent. Since Widget API doesn't allow to | 392 // will cause multiple call of OnInputEvent. Since Widget API doesn't allow to |
| 390 // check whether the observer is already added, the observer is removed and | 393 // check whether the observer is already added, the observer is removed and |
| 391 // added again, to ensure that it is added only once. | 394 // added again, to ensure that it is added only once. |
| 392 web_contents()->GetRenderViewHost()->GetWidget()->RemoveInputEventObserver( | 395 web_contents()->GetRenderViewHost()->GetWidget()->RemoveInputEventObserver( |
| 393 this); | 396 this); |
| 394 web_contents()->GetRenderViewHost()->GetWidget()->AddInputEventObserver(this); | 397 web_contents()->GetRenderViewHost()->GetWidget()->AddInputEventObserver(this); |
| 395 } | 398 } |
| 396 | 399 |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 // static | 653 // static |
| 651 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { | 654 bool ChromePasswordManagerClient::CanShowBubbleOnURL(const GURL& url) { |
| 652 std::string scheme = url.scheme(); | 655 std::string scheme = url.scheme(); |
| 653 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( | 656 return (content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( |
| 654 scheme) && | 657 scheme) && |
| 655 #if BUILDFLAG(ENABLE_EXTENSIONS) | 658 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 656 scheme != extensions::kExtensionScheme && | 659 scheme != extensions::kExtensionScheme && |
| 657 #endif | 660 #endif |
| 658 scheme != content::kChromeDevToolsScheme); | 661 scheme != content::kChromeDevToolsScheme); |
| 659 } | 662 } |
| OLD | NEW |