Index: components/password_manager/core/browser/affiliation_utils.cc |
diff --git a/components/password_manager/core/browser/affiliation_utils.cc b/components/password_manager/core/browser/affiliation_utils.cc |
index ee1d9b06f6846fa25c94104bc3bbd93c62fbcd68..f01714a3de27ccd88c73197ea3f3c7abd0c218b8 100644 |
--- a/components/password_manager/core/browser/affiliation_utils.cc |
+++ b/components/password_manager/core/browser/affiliation_utils.cc |
@@ -13,6 +13,7 @@ |
#include "base/strings/string_piece.h" |
#include "base/strings/string_util.h" |
#include "components/password_manager/core/common/password_manager_switches.h" |
+#include "components/variations/variations_associated_data.h" |
#include "net/base/escape.h" |
#include "url/third_party/mozilla/url_parse.h" |
#include "url/url_canon_stdstring.h" |
@@ -25,6 +26,9 @@ namespace { |
// The scheme used for identifying Android applications. |
const char kAndroidAppScheme[] = "android"; |
+// The name of the field trial controlling affiliation-based matching. |
+const char kFieldTrialName[] = "AffiliationBasedMatching"; |
+ |
// Returns a StringPiece corresponding to |component| in |uri|, or the empty |
// string in case there is no such component. |
base::StringPiece ComponentString(const std::string& uri, |
@@ -292,7 +296,7 @@ bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) { |
// Note: It is important to always query the field trial state, to ensure that |
// UMA reports the correct group. |
const std::string group_name = |
- base::FieldTrialList::FindFullName("AffiliationBasedMatching"); |
+ base::FieldTrialList::FindFullName(kFieldTrialName); |
if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching)) |
return false; |
@@ -301,6 +305,20 @@ bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) { |
return StartsWithASCII(group_name, "Enabled", /*case_sensitive=*/false); |
} |
+bool IsPropagatingPasswordChangesToWebCredentialsEnabled( |
+ const base::CommandLine& command_line) { |
+ // Note: It is important to always query the field trial state, to ensure that |
+ // UMA reports the correct group. |
vasilii
2015/04/20 16:25:19
Can you elaborate?
engedy
2015/04/20 18:31:58
Done.
|
+ const std::string update_enabled = variations::GetVariationParamValue( |
+ kFieldTrialName, "propagate_password_changes_to_web"); |
+ |
+ if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching)) |
+ return false; |
+ if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching)) |
+ return true; |
+ return LowerCaseEqualsASCII(update_enabled, "enabled"); |
+} |
+ |
bool IsValidAndroidFacetURI(const std::string& url) { |
FacetURI facet = FacetURI::FromPotentiallyInvalidSpec(url); |
return facet.IsValidAndroidFacetURI(); |