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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
565 return true; | 564 return true; |
566 #endif | 565 #endif |
567 } | 566 } |
568 | 567 |
569 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const { | 568 bool ChromePasswordManagerClient::IsUpdatePasswordUIEnabled() const { |
570 // Currently Password update UI is implemented only for Bubble UI. | 569 // Currently Password update UI is implemented only for Bubble UI. |
571 return IsTheHotNewBubbleUIEnabled(); | 570 return IsTheHotNewBubbleUIEnabled(); |
572 } | 571 } |
573 | 572 |
574 bool ChromePasswordManagerClient::EnabledForSyncSignin() { | 573 bool ChromePasswordManagerClient::EnabledForSyncSignin() { |
575 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 574 if (password_manager_util::IsFeatureDisabledFromCommandLine( |
576 if (command_line->HasSwitch( | 575 password_manager::features::kManagerForSyncSignin)) { |
Bernhard Bauer
2016/02/11 11:12:40
I don't think this is necessary; FeatureList will
Pritam Nikam
2016/02/25 14:16:06
Done.
| |
577 password_manager::switches::kDisableManagerForSyncSignin)) | |
578 return false; | 576 return false; |
577 } | |
579 | 578 |
580 if (command_line->HasSwitch( | 579 if (base::FeatureList::IsEnabled( |
581 password_manager::switches::kEnableManagerForSyncSignin)) | 580 password_manager::features::kManagerForSyncSignin)) { |
582 return true; | 581 return true; |
582 } | |
583 | 583 |
584 // Default is enabled. | 584 // Default is enabled. |
585 std::string group_name = | 585 std::string group_name = |
586 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); | 586 base::FieldTrialList::FindFullName("PasswordManagerStateForSyncSignin"); |
587 return group_name != "Disabled"; | 587 return group_name != "Disabled"; |
588 } | 588 } |
589 | 589 |
590 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { | 590 const GURL& ChromePasswordManagerClient::GetMainFrameURL() const { |
591 return web_contents()->GetVisibleURL(); | 591 return web_contents()->GetVisibleURL(); |
592 } | 592 } |
(...skipping 10 matching lines...) Expand all Loading... | |
603 | 603 |
604 const password_manager::CredentialsFilter* | 604 const password_manager::CredentialsFilter* |
605 ChromePasswordManagerClient::GetStoreResultFilter() const { | 605 ChromePasswordManagerClient::GetStoreResultFilter() const { |
606 return &credentials_filter_; | 606 return &credentials_filter_; |
607 } | 607 } |
608 | 608 |
609 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() | 609 const password_manager::LogManager* ChromePasswordManagerClient::GetLogManager() |
610 const { | 610 const { |
611 return log_manager_.get(); | 611 return log_manager_.get(); |
612 } | 612 } |
OLD | NEW |