| 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 28 matching lines...) Expand all Loading... |
| 39 #include "components/password_manager/core/browser/log_receiver.h" | 39 #include "components/password_manager/core/browser/log_receiver.h" |
| 40 #include "components/password_manager/core/browser/password_bubble_experiment.h" | 40 #include "components/password_manager/core/browser/password_bubble_experiment.h" |
| 41 #include "components/password_manager/core/browser/password_form_manager.h" | 41 #include "components/password_manager/core/browser/password_form_manager.h" |
| 42 #include "components/password_manager/core/browser/password_manager_internals_se
rvice.h" | 42 #include "components/password_manager/core/browser/password_manager_internals_se
rvice.h" |
| 43 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 43 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 44 #include "components/password_manager/core/browser/password_manager_settings_mig
ration_experiment.h" | 44 #include "components/password_manager/core/browser/password_manager_settings_mig
ration_experiment.h" |
| 45 #include "components/password_manager/core/browser/password_manager_util.h" | 45 #include "components/password_manager/core/browser/password_manager_util.h" |
| 46 #include "components/password_manager/core/common/credential_manager_types.h" | 46 #include "components/password_manager/core/common/credential_manager_types.h" |
| 47 #include "components/password_manager/core/common/password_manager_features.h" | 47 #include "components/password_manager/core/common/password_manager_features.h" |
| 48 #include "components/password_manager/core/common/password_manager_pref_names.h" | 48 #include "components/password_manager/core/common/password_manager_pref_names.h" |
| 49 #include "components/password_manager/core/common/password_manager_switches.h" | |
| 50 #include "components/password_manager/sync/browser/password_sync_util.h" | 49 #include "components/password_manager/sync/browser/password_sync_util.h" |
| 51 #include "components/prefs/pref_service.h" | 50 #include "components/prefs/pref_service.h" |
| 52 #include "components/signin/core/browser/signin_manager.h" | 51 #include "components/signin/core/browser/signin_manager.h" |
| 53 #include "components/version_info/version_info.h" | 52 #include "components/version_info/version_info.h" |
| 54 #include "content/public/browser/navigation_entry.h" | 53 #include "content/public/browser/navigation_entry.h" |
| 55 #include "content/public/browser/render_view_host.h" | 54 #include "content/public/browser/render_view_host.h" |
| 56 #include "content/public/browser/web_contents.h" | 55 #include "content/public/browser/web_contents.h" |
| 57 #include "google_apis/gaia/gaia_urls.h" | 56 #include "google_apis/gaia/gaia_urls.h" |
| 58 #include "net/base/url_util.h" | 57 #include "net/base/url_util.h" |
| 59 #include "third_party/re2/src/re2/re2.h" | 58 #include "third_party/re2/src/re2/re2.h" |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 return true; | 556 return true; |
| 558 #endif | 557 #endif |
| 559 } | 558 } |
| 560 | 559 |
| 561 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const { | 560 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const { |
| 562 // Currently Password update UI is implemented only for Bubble UI. | 561 // Currently Password update UI is implemented only for Bubble UI. |
| 563 return IsTheHotNewBubbleUIEnabled(); | 562 return IsTheHotNewBubbleUIEnabled(); |
| 564 } | 563 } |
| 565 | 564 |
| 566 bool ChromePasswordManagerClient::EnabledForSyncSignin() { | 565 bool ChromePasswordManagerClient::EnabledForSyncSignin() { |
| 567 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 566 if (base::FeatureList::IsEnabled( |
| 568 if (command_line->HasSwitch( | 567 password_manager::features::kDisableManagerForSyncSignin)) { |
| 569 password_manager::switches::kDisableManagerForSyncSignin)) | |
| 570 return false; | 568 return false; |
| 569 } |
| 571 | 570 |
| 572 if (command_line->HasSwitch( | 571 if (base::FeatureList::IsEnabled( |
| 573 password_manager::switches::kEnableManagerForSyncSignin)) | 572 password_manager::features::kEnableManagerForSyncSignin)) { |
| 574 return true; | 573 return true; |
| 574 } |
| 575 | 575 |
| 576 // Default is enabled. | 576 // Default is enabled. |
| 577 std::string group_name = | 577 std::string group_name = |
| 578 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); | 578 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); |
| 579 return group_name != "Disabled"; | 579 return group_name != "Disabled"; |
| 580 } | 580 } |
| 581 | 581 |
| 582 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { | 582 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { |
| 583 return web_contents()->GetVisibleURL(); | 583 return web_contents()->GetVisibleURL(); |
| 584 } | 584 } |
| (...skipping 10 matching lines...) Expand all Loading... |
| 595 | 595 |
| 596 const password_manager::CredentialsFilter* | 596 const password_manager::CredentialsFilter* |
| 597 ChromePasswordManagerClient::GetStoreResultFilter() const { | 597 ChromePasswordManagerClient::GetStoreResultFilter() const { |
| 598 return &credentials_filter_; | 598 return &credentials_filter_; |
| 599 } | 599 } |
| 600 | 600 |
| 601 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() | 601 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() |
| 602 const { | 602 const { |
| 603 return log_manager_.get(); | 603 return log_manager_.get(); |
| 604 } | 604 } |
| OLD | NEW |