• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 // Constants for the Chrome Extensions Proxy Settings API.
6 
7 #include "chrome/browser/extensions/api/proxy/proxy_api_constants.h"
8 
9 #include "base/basictypes.h"
10 
11 namespace extensions {
12 namespace proxy_api_constants {
13 
14 const char kProxyConfigMode[] = "mode";
15 const char kProxyConfigPacScript[] = "pacScript";
16 const char kProxyConfigPacScriptMandatory[] = "mandatory";
17 const char kProxyConfigPacScriptUrl[] = "url";
18 const char kProxyConfigPacScriptData[] = "data";
19 const char kProxyConfigRules[] = "rules";
20 const char kProxyConfigRuleHost[] = "host";
21 const char kProxyConfigRulePort[] = "port";
22 const char kProxyConfigRuleScheme[] = "scheme";
23 const char kProxyConfigBypassList[] = "bypassList";
24 
25 const char kProxyEventFatal[] = "fatal";
26 const char kProxyEventError[] = "error";
27 const char kProxyEventDetails[] = "details";
28 const char kProxyEventOnProxyError[] = "proxy.onProxyError";
29 
30 const char kPACDataUrlPrefix[] =
31     "data:application/x-ns-proxy-autoconfig;base64,";
32 
33 const char* field_name[] = { "singleProxy",
34                              "proxyForHttp",
35                              "proxyForHttps",
36                              "proxyForFtp",
37                              "fallbackProxy" };
38 
39 const char* scheme_name[] = { "*error*",
40                               "http",
41                               "https",
42                               "ftp",
43                               "socks" };
44 
45 COMPILE_ASSERT(SCHEME_MAX == SCHEME_FALLBACK,
46                SCHEME_MAX_must_equal_SCHEME_FALLBACK);
47 COMPILE_ASSERT(arraysize(field_name) == SCHEME_MAX + 1,
48                field_name_array_is_wrong_size);
49 COMPILE_ASSERT(arraysize(scheme_name) == SCHEME_MAX + 1,
50                scheme_name_array_is_wrong_size);
51 COMPILE_ASSERT(SCHEME_ALL == 0, singleProxy_must_be_first_option);
52 
53 }  // namespace proxy_api_constants
54 }  // extensions
55