Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/proxy_config/proxy_prefs.h" | 5 #include "components/proxy_config/proxy_prefs.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace ProxyPrefs { | 10 namespace ProxyPrefs { |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 static_assert(arraysize(kProxyModeNames) == kModeCount, | 22 static_assert(arraysize(kProxyModeNames) == kModeCount, |
| 23 "kProxyModeNames must have kModeCount elements"); | 23 "kProxyModeNames must have kModeCount elements"); |
| 24 | 24 |
| 25 } // namespace | 25 } // namespace |
| 26 | 26 |
| 27 const char kDirectProxyModeName[] = "direct"; | 27 const char kDirectProxyModeName[] = "direct"; |
| 28 const char kAutoDetectProxyModeName[] = "auto_detect"; | 28 const char kAutoDetectProxyModeName[] = "auto_detect"; |
| 29 const char kPacScriptProxyModeName[] = "pac_script"; | 29 const char kPacScriptProxyModeName[] = "pac_script"; |
| 30 const char kFixedServersProxyModeName[] = "fixed_servers"; | 30 const char kFixedServersProxyModeName[] = "fixed_servers"; |
| 31 const char kSystemProxyModeName[] = "system"; | 31 const char kSystemProxyModeName[] = "system"; |
| 32 const char kProxy[] = "proxy"; | |
|
droger
2015/08/17 13:51:36
Keep the original comment:
// Preference to store
Abhishek
2015/08/19 08:30:49
Done.
| |
| 32 | 33 |
| 33 bool IntToProxyMode(int in_value, ProxyMode* out_value) { | 34 bool IntToProxyMode(int in_value, ProxyMode* out_value) { |
| 34 DCHECK(out_value); | 35 DCHECK(out_value); |
| 35 if (in_value < 0 || in_value >= kModeCount) | 36 if (in_value < 0 || in_value >= kModeCount) |
| 36 return false; | 37 return false; |
| 37 *out_value = static_cast<ProxyMode>(in_value); | 38 *out_value = static_cast<ProxyMode>(in_value); |
| 38 return true; | 39 return true; |
| 39 } | 40 } |
| 40 | 41 |
| 41 bool StringToProxyMode(const std::string& in_value, ProxyMode* out_value) { | 42 bool StringToProxyMode(const std::string& in_value, ProxyMode* out_value) { |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 64 case CONFIG_FALLBACK: | 65 case CONFIG_FALLBACK: |
| 65 return "config_fallback"; | 66 return "config_fallback"; |
| 66 case CONFIG_UNSET: | 67 case CONFIG_UNSET: |
| 67 return "config_unset"; | 68 return "config_unset"; |
| 68 } | 69 } |
| 69 NOTREACHED(); | 70 NOTREACHED(); |
| 70 return ""; | 71 return ""; |
| 71 } | 72 } |
| 72 | 73 |
| 73 } // namespace ProxyPrefs | 74 } // namespace ProxyPrefs |
| OLD | NEW |