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.
5 #include "net/proxy/dhcp_proxy_script_fetcher_factory.h"
7 #include "net/base/net_errors.h"
8 #include "net/proxy/dhcp_proxy_script_fetcher.h"
11 #include "net/proxy/dhcp_proxy_script_fetcher_win.h"
16 DhcpProxyScriptFetcherFactory::DhcpProxyScriptFetcherFactory()
17 : feature_enabled_(false) {
21 scoped_ptr
<DhcpProxyScriptFetcher
> DhcpProxyScriptFetcherFactory::Create(
22 URLRequestContext
* context
) {
23 if (!feature_enabled_
) {
24 return make_scoped_ptr(new DoNothingDhcpProxyScriptFetcher());
26 DCHECK(IsSupported());
27 scoped_ptr
<DhcpProxyScriptFetcher
> ret
;
29 ret
.reset(new DhcpProxyScriptFetcherWin(context
));
36 void DhcpProxyScriptFetcherFactory::set_enabled(bool enabled
) {
38 feature_enabled_
= enabled
;
42 bool DhcpProxyScriptFetcherFactory::enabled() const {
43 return feature_enabled_
;
47 bool DhcpProxyScriptFetcherFactory::IsSupported() {