| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/psl_matching_helper.h" | 5 #include "chrome/browser/password_manager/psl_matching_helper.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "chrome/common/chrome_switches.h" | 10 #include "chrome/common/chrome_switches.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 48 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 49 } | 49 } |
| 50 | 50 |
| 51 // static | 51 // static |
| 52 void PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting() { | 52 void PSLMatchingHelper::EnablePublicSuffixDomainMatchingForTesting() { |
| 53 psl_enabled_override_ = true; | 53 psl_enabled_override_ = true; |
| 54 } | 54 } |
| 55 | 55 |
| 56 // static | 56 // static |
| 57 bool PSLMatchingHelper::DeterminePSLEnabled() { | 57 bool PSLMatchingHelper::DeterminePSLEnabled() { |
| 58 #if defined(OS_ANDROID) || defined(OS_WIN) || defined(OS_LINUX) | 58 #if defined(OS_ANDROID) || defined(OS_WIN) |
| 59 // Default choice is "enabled", so we do not need to check for | 59 // Default choice is "enabled", so we do not need to check for |
| 60 // kEnablePasswordAutofillPublicSuffixDomainMatching. | 60 // kEnablePasswordAutofillPublicSuffixDomainMatching. |
| 61 bool enabled = true; | 61 bool enabled = true; |
| 62 if (CommandLine::ForCurrentProcess()->HasSwitch( | 62 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 63 switches::kDisablePasswordAutofillPublicSuffixDomainMatching)) { | 63 switches::kDisablePasswordAutofillPublicSuffixDomainMatching)) { |
| 64 enabled = false; | 64 enabled = false; |
| 65 } | 65 } |
| 66 return enabled; | 66 return enabled; |
| 67 #else | 67 #else |
| 68 return false; | 68 return false; |
| 69 #endif | 69 #endif |
| 70 } | 70 } |
| OLD | NEW |