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 "components/password_manager/core/browser/affiliation_utils.h" | 5 #include "components/password_manager/core/browser/affiliation_utils.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/command_line.h" | |
10 #include "base/strings/string_piece.h" | 11 #include "base/strings/string_piece.h" |
11 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "components/password_manager/core/common/password_manager_switches.h" | |
14 #include "components/variations/variations_associated_data.h" | |
12 #include "net/base/escape.h" | 15 #include "net/base/escape.h" |
13 #include "url/third_party/mozilla/url_parse.h" | 16 #include "url/third_party/mozilla/url_parse.h" |
14 #include "url/url_canon_stdstring.h" | 17 #include "url/url_canon_stdstring.h" |
15 #include "url/url_util.h" | 18 #include "url/url_util.h" |
16 | 19 |
17 namespace password_manager { | 20 namespace password_manager { |
18 | 21 |
19 namespace { | 22 namespace { |
20 | 23 |
21 // The scheme used for identifying Android applications. | 24 // The scheme used for identifying Android applications. |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
273 if (a.size() != b.size()) | 276 if (a.size() != b.size()) |
274 return false; | 277 return false; |
275 | 278 |
276 std::vector<FacetURI> a_sorted(a.begin(), a.end()); | 279 std::vector<FacetURI> a_sorted(a.begin(), a.end()); |
277 std::vector<FacetURI> b_sorted(b.begin(), b.end()); | 280 std::vector<FacetURI> b_sorted(b.begin(), b.end()); |
278 std::sort(a_sorted.begin(), a_sorted.end()); | 281 std::sort(a_sorted.begin(), a_sorted.end()); |
279 std::sort(b_sorted.begin(), b_sorted.end()); | 282 std::sort(b_sorted.begin(), b_sorted.end()); |
280 return std::equal(a_sorted.begin(), a_sorted.end(), b_sorted.begin()); | 283 return std::equal(a_sorted.begin(), a_sorted.end(), b_sorted.begin()); |
281 } | 284 } |
282 | 285 |
286 bool IsAffiliationBasedMatchingEnabled(const base::CommandLine& command_line) { | |
287 if (command_line.HasSwitch(switches::kDisableAffiliationBasedMatching)) | |
288 return false; | |
289 | |
290 if (command_line.HasSwitch(switches::kEnableAffiliationBasedMatching)) | |
291 return true; | |
292 | |
293 return variations::GetVariationParamValue("AffiliationBasedMatching", | |
294 "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
| |
295 } | |
296 | |
283 } // namespace password_manager | 297 } // namespace password_manager |
OLD | NEW |