| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "net/proxy/proxy_config_source.h" | 5 #include "net/proxy/proxy_config_source.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 9 | 8 |
| 10 namespace net { | 9 namespace net { |
| 11 | 10 |
| 12 namespace { | 11 namespace { |
| 13 | 12 |
| 14 const char* const kSourceNames[] = { | 13 const char* const kSourceNames[] = { |
| 15 "UNKNOWN", | 14 "UNKNOWN", |
| 16 "SYSTEM", | 15 "SYSTEM", |
| 17 "SYSTEM FAILED", | 16 "SYSTEM FAILED", |
| 18 "GCONF", | 17 "GCONF", |
| 19 "GSETTINGS", | 18 "GSETTINGS", |
| 20 "KDE", | 19 "KDE", |
| 21 "ENV", | 20 "ENV", |
| 22 "CUSTOM", | 21 "CUSTOM", |
| 23 "TEST" | 22 "TEST" |
| 24 }; | 23 }; |
| 25 static_assert(arraysize(kSourceNames) == NUM_PROXY_CONFIG_SOURCES, | 24 static_assert(arraysize(kSourceNames) == NUM_PROXY_CONFIG_SOURCES, |
| 26 "kSourceNames has incorrect size"); | 25 "kSourceNames has incorrect size"); |
| 27 | 26 |
| 28 } // namespace | 27 } // namespace |
| 29 | 28 |
| 30 const char* ProxyConfigSourceToString(ProxyConfigSource source) { | 29 const char* ProxyConfigSourceToString(ProxyConfigSource source) { |
| 31 DCHECK_GT(NUM_PROXY_CONFIG_SOURCES, source); | 30 DCHECK_GT(NUM_PROXY_CONFIG_SOURCES, source); |
| 32 return kSourceNames[source]; | 31 return kSourceNames[source]; |
| 33 } | 32 } |
| 34 | 33 |
| 35 } // namespace net | 34 } // namespace net |
| OLD | NEW |