| 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" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 const char* kSourceNames[] = { | 14 const char* kSourceNames[] = {"UNKNOWN", "SYSTEM", "SYSTEM FAILED", |
| 15 "UNKNOWN", | 15 "GCONF", "GSETTINGS", "KDE", |
| 16 "SYSTEM", | 16 "ENV", "CUSTOM", "TEST"}; |
| 17 "SYSTEM FAILED", | |
| 18 "GCONF", | |
| 19 "GSETTINGS", | |
| 20 "KDE", | |
| 21 "ENV", | |
| 22 "CUSTOM", | |
| 23 "TEST" | |
| 24 }; | |
| 25 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kSourceNames) == NUM_PROXY_CONFIG_SOURCES, | 17 COMPILE_ASSERT(ARRAYSIZE_UNSAFE(kSourceNames) == NUM_PROXY_CONFIG_SOURCES, |
| 26 source_names_incorrect_size); | 18 source_names_incorrect_size); |
| 27 | 19 |
| 28 } // namespace | 20 } // namespace |
| 29 | 21 |
| 30 const char* ProxyConfigSourceToString(ProxyConfigSource source) { | 22 const char* ProxyConfigSourceToString(ProxyConfigSource source) { |
| 31 DCHECK_GT(NUM_PROXY_CONFIG_SOURCES, source); | 23 DCHECK_GT(NUM_PROXY_CONFIG_SOURCES, source); |
| 32 return kSourceNames[source]; | 24 return kSourceNames[source]; |
| 33 } | 25 } |
| 34 | 26 |
| 35 } // namespace net | 27 } // namespace net |
| OLD | NEW |