Only send _NET_ACTIVE_WINDOW hint if the chromium window is not already active.
[chromium-blink-merge.git] / chromeos / network / dhcp_proxy_script_fetcher_chromeos.h
blobf0d3c4fcc094041e48c1ce56497dc1c9f4dff260
1 // Copyright (c) 2013 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 #ifndef CHROMEOS_NETWORK_DHCP_PROXY_SCRIPT_FETCHER_CHROMEOS_H_
6 #define CHROMEOS_NETWORK_DHCP_PROXY_SCRIPT_FETCHER_CHROMEOS_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chromeos/chromeos_export.h"
11 #include "net/proxy/dhcp_proxy_script_fetcher.h"
12 #include "url/gurl.h"
14 namespace base {
15 class SingleThreadTaskRunner;
18 namespace net {
19 class URLRequestContext;
20 class ProxyScriptFetcher;
23 namespace chromeos {
25 // ChromeOS specific implementation of DhcpProxyScriptFetcher.
26 // This looks up Service.WebProxyAutoDiscoveryUrl for the default network
27 // from Shill and uses that to fetch the proxy script if available.
28 class CHROMEOS_EXPORT DhcpProxyScriptFetcherChromeos
29 : public net::DhcpProxyScriptFetcher {
30 public:
31 explicit DhcpProxyScriptFetcherChromeos(
32 net::URLRequestContext* url_request_context);
33 ~DhcpProxyScriptFetcherChromeos() override;
35 // net::DhcpProxyScriptFetcher
36 int Fetch(base::string16* utf16_text,
37 const net::CompletionCallback& callback) override;
38 void Cancel() override;
39 const GURL& GetPacURL() const override;
40 std::string GetFetcherName() const override;
42 private:
43 void ContinueFetch(base::string16* utf16_text,
44 net::CompletionCallback callback,
45 std::string pac_url);
47 net::URLRequestContext* url_request_context_; // Weak ptr
48 scoped_ptr<net::ProxyScriptFetcher> proxy_script_fetcher_;
49 scoped_refptr<base::SingleThreadTaskRunner> network_handler_task_runner_;
51 GURL pac_url_;
53 base::WeakPtrFactory<DhcpProxyScriptFetcherChromeos> weak_ptr_factory_;
55 DISALLOW_COPY_AND_ASSIGN(DhcpProxyScriptFetcherChromeos);
58 } // namespace chromeos
60 #endif // CHROMEOS_NETWORK_DHCP_PROXY_SCRIPT_FETCHER_CHROMEOS_H_