Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Unified Diff: components/password_manager/core/browser/affiliation_utils.cc

Issue 898553002: Add flag to enable/disable affiliaton based matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ad9e0ac6ec49574affe252e8b545d8e474bdf344..1d94edb28e50de738ccd3c4c17d3c9d93e7b84de 100644
--- a/components/password_manager/core/browser/affiliation_utils.cc
+++ b/components/password_manager/core/browser/affiliation_utils.cc
@@ -7,8 +7,11 @@
#include <algorithm>
#include "base/base64.h"
+#include "base/command_line.h"
#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"
@@ -280,4 +283,15 @@ bool AreEquivalenceClassesEqual(const AffiliatedFacets& a,
return std::equal(a_sorted.begin(), a_sorted.end(), b_sorted.begin());
}
+bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching))
+ return false;
+
+ if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching))
+ return true;
+
+ return variations::GetVariationParamValue("AffiliationBasedMatching",
+ "enabled") == "true";
Garrett Casto 2015/02/03 05:32:41 Alexei can talk more about how appropriate it is t
Alexei Svitkine (slow) 2015/02/03 17:27:41 Indeed, it's needed to activate the trial. Using
engedy 2015/02/03 18:24:27 Thanks. Then I might as well just use field trials
+}
+
} // namespace password_manager

Powered by Google App Engine
This is Rietveld 408576698