| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 // Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord | 382 // Always use EXPLICIT_ACCESS as the password manager checks IsOffTheRecord |
| 383 // itself when it shouldn't access the PasswordStore. | 383 // itself when it shouldn't access the PasswordStore. |
| 384 // TODO(gcasto): Is is safe to change this to | 384 // TODO(gcasto): Is is safe to change this to |
| 385 // ServiceAccessType::IMPLICIT_ACCESS? | 385 // ServiceAccessType::IMPLICIT_ACCESS? |
| 386 return PasswordStoreFactory::GetForProfile( | 386 return PasswordStoreFactory::GetForProfile( |
| 387 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); | 387 profile_, ServiceAccessType::EXPLICIT_ACCESS).get(); |
| 388 } | 388 } |
| 389 | 389 |
| 390 password_manager::PasswordSyncState | 390 password_manager::PasswordSyncState |
| 391 ChromePasswordManagerClient::GetPasswordSyncState() const { | 391 ChromePasswordManagerClient::GetPasswordSyncState() const { |
| 392 const ProfileSyncService* sync_service = | 392 const browser_sync::ProfileSyncService* sync_service = |
| 393 ProfileSyncServiceFactory::GetForProfile(profile_); | 393 ProfileSyncServiceFactory::GetForProfile(profile_); |
| 394 return password_manager_util::GetPasswordSyncState(sync_service); | 394 return password_manager_util::GetPasswordSyncState(sync_service); |
| 395 } | 395 } |
| 396 | 396 |
| 397 bool ChromePasswordManagerClient::WasLastNavigationHTTPError() const { | 397 bool ChromePasswordManagerClient::WasLastNavigationHTTPError() const { |
| 398 DCHECK(web_contents()); | 398 DCHECK(web_contents()); |
| 399 | 399 |
| 400 std::unique_ptr<password_manager::BrowserSavePasswordProgressLogger> logger; | 400 std::unique_ptr<password_manager::BrowserSavePasswordProgressLogger> logger; |
| 401 if (log_manager_->IsLoggingActive()) { | 401 if (log_manager_->IsLoggingActive()) { |
| 402 logger.reset(new password_manager::BrowserSavePasswordProgressLogger( | 402 logger.reset(new password_manager::BrowserSavePasswordProgressLogger( |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 577 } | 577 } |
| 578 | 578 |
| 579 // static | 579 // static |
| 580 bool ChromePasswordManagerClient::ShouldAnnotateNavigationEntries( | 580 bool ChromePasswordManagerClient::ShouldAnnotateNavigationEntries( |
| 581 Profile* profile) { | 581 Profile* profile) { |
| 582 // Only annotate PasswordState onto the navigation entry if user is | 582 // Only annotate PasswordState onto the navigation entry if user is |
| 583 // opted into UMA and they're not syncing w/ a custom passphrase. | 583 // opted into UMA and they're not syncing w/ a custom passphrase. |
| 584 if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) | 584 if (!ChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled()) |
| 585 return false; | 585 return false; |
| 586 | 586 |
| 587 ProfileSyncService* profile_sync_service = | 587 browser_sync::ProfileSyncService* profile_sync_service = |
| 588 ProfileSyncServiceFactory::GetForProfile(profile); | 588 ProfileSyncServiceFactory::GetForProfile(profile); |
| 589 if (!profile_sync_service || !profile_sync_service->IsSyncActive() || | 589 if (!profile_sync_service || !profile_sync_service->IsSyncActive() || |
| 590 profile_sync_service->IsUsingSecondaryPassphrase()) { | 590 profile_sync_service->IsUsingSecondaryPassphrase()) { |
| 591 return false; | 591 return false; |
| 592 } | 592 } |
| 593 | 593 |
| 594 return true; | 594 return true; |
| 595 } | 595 } |
| 596 | 596 |
| 597 void ChromePasswordManagerClient::AnnotateNavigationEntry( | 597 void ChromePasswordManagerClient::AnnotateNavigationEntry( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 password_manager::mojom::CredentialManagerRequest request) { | 632 password_manager::mojom::CredentialManagerRequest request) { |
| 633 content::WebContents* web_contents = | 633 content::WebContents* web_contents = |
| 634 content::WebContents::FromRenderFrameHost(render_frame_host); | 634 content::WebContents::FromRenderFrameHost(render_frame_host); |
| 635 DCHECK(web_contents); | 635 DCHECK(web_contents); |
| 636 | 636 |
| 637 ChromePasswordManagerClient* instance = | 637 ChromePasswordManagerClient* instance = |
| 638 ChromePasswordManagerClient::FromWebContents(web_contents); | 638 ChromePasswordManagerClient::FromWebContents(web_contents); |
| 639 DCHECK(instance); | 639 DCHECK(instance); |
| 640 instance->credential_manager_impl_.BindRequest(std::move(request)); | 640 instance->credential_manager_impl_.BindRequest(std::move(request)); |
| 641 } | 641 } |
| OLD | NEW |