Home | History | Annotate | Download | only in extensions
      1 // Copyright (c) 2011 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/extension_proxy_api_constants.h"
      8 
      9 #include "base/basictypes.h"
     10 
     11 namespace extension_proxy_api_constants {
     12 
     13 const char kProxyConfigMode[] = "mode";
     14 const char kProxyConfigPacScript[] = "pacScript";
     15 const char kProxyConfigPacScriptUrl[] = "url";
     16 const char kProxyConfigPacScriptData[] = "data";
     17 const char kProxyConfigRules[] = "rules";
     18 const char kProxyConfigRuleHost[] = "host";
     19 const char kProxyConfigRulePort[] = "port";
     20 const char kProxyConfigRuleScheme[] = "scheme";
     21 const char kProxyConfigBypassList[] = "bypassList";
     22 const char kProxyConfigValue[] = "value";
     23 
     24 const char kProxyEventFatal[] = "fatal";
     25 const char kProxyEventError[] = "error";
     26 const char kProxyEventDetails[] = "details";
     27 const char kProxyEventOnProxyError[] = "experimental.proxy.onProxyError";
     28 
     29 const char kPACDataUrlPrefix[] =
     30     "data:application/x-ns-proxy-autoconfig;base64,";
     31 
     32 const char* field_name[] = { "singleProxy",
     33                              "proxyForHttp",
     34                              "proxyForHttps",
     35                              "proxyForFtp",
     36                              "fallbackProxy" };
     37 
     38 const char* scheme_name[] = { "*error*",
     39                               "http",
     40                               "https",
     41                               "ftp",
     42                               "socks" };
     43 
     44 COMPILE_ASSERT(SCHEME_MAX == SCHEME_FALLBACK,
     45                SCHEME_MAX_must_equal_SCHEME_FALLBACK);
     46 COMPILE_ASSERT(arraysize(field_name) == SCHEME_MAX + 1,
     47                field_name_array_is_wrong_size);
     48 COMPILE_ASSERT(arraysize(scheme_name) == SCHEME_MAX + 1,
     49                scheme_name_array_is_wrong_size);
     50 COMPILE_ASSERT(SCHEME_ALL == 0, singleProxy_must_be_first_option);
     51 
     52 }  // namespace extension_proxy_api_constants
     53