OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ | 5 #ifndef NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ |
6 #define NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ | 6 #define NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <winhttp.h> | 9 #include <winhttp.h> |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 // change, or in case we got it wrong (and are not checking all possible | 40 // change, or in case we got it wrong (and are not checking all possible |
41 // registry dependencies). | 41 // registry dependencies). |
42 class NET_EXPORT_PRIVATE ProxyConfigServiceWin | 42 class NET_EXPORT_PRIVATE ProxyConfigServiceWin |
43 : public PollingProxyConfigService, | 43 : public PollingProxyConfigService, |
44 public base::win::ObjectWatcher::Delegate { | 44 public base::win::ObjectWatcher::Delegate { |
45 public: | 45 public: |
46 ProxyConfigServiceWin(); | 46 ProxyConfigServiceWin(); |
47 virtual ~ProxyConfigServiceWin(); | 47 virtual ~ProxyConfigServiceWin(); |
48 | 48 |
49 // Overrides a function from PollingProxyConfigService. | 49 // Overrides a function from PollingProxyConfigService. |
50 virtual void AddObserver(Observer* observer) OVERRIDE; | 50 virtual void AddObserver(Observer* observer) override; |
51 | 51 |
52 private: | 52 private: |
53 FRIEND_TEST_ALL_PREFIXES(ProxyConfigServiceWinTest, SetFromIEConfig); | 53 FRIEND_TEST_ALL_PREFIXES(ProxyConfigServiceWinTest, SetFromIEConfig); |
54 class KeyEntry; | 54 class KeyEntry; |
55 typedef std::vector<KeyEntry*> KeyEntryList; | 55 typedef std::vector<KeyEntry*> KeyEntryList; |
56 | 56 |
57 // Registers change observers on the registry keys relating to proxy settings. | 57 // Registers change observers on the registry keys relating to proxy settings. |
58 void StartWatchingRegistryForChanges(); | 58 void StartWatchingRegistryForChanges(); |
59 | 59 |
60 // Creates a new KeyEntry and appends it to |keys_to_watch_|. If the key | 60 // Creates a new KeyEntry and appends it to |keys_to_watch_|. If the key |
61 // fails to be created, it is not appended to the list and we return false. | 61 // fails to be created, it is not appended to the list and we return false. |
62 bool AddKeyToWatchList(HKEY rootkey, const wchar_t* subkey); | 62 bool AddKeyToWatchList(HKEY rootkey, const wchar_t* subkey); |
63 | 63 |
64 // ObjectWatcher::Delegate methods: | 64 // ObjectWatcher::Delegate methods: |
65 // This is called whenever one of the registry keys we are watching change. | 65 // This is called whenever one of the registry keys we are watching change. |
66 virtual void OnObjectSignaled(HANDLE object) OVERRIDE; | 66 virtual void OnObjectSignaled(HANDLE object) override; |
67 | 67 |
68 static void GetCurrentProxyConfig(ProxyConfig* config); | 68 static void GetCurrentProxyConfig(ProxyConfig* config); |
69 | 69 |
70 // Set |config| using the proxy configuration values of |ie_config|. | 70 // Set |config| using the proxy configuration values of |ie_config|. |
71 static void SetFromIEConfig( | 71 static void SetFromIEConfig( |
72 ProxyConfig* config, | 72 ProxyConfig* config, |
73 const WINHTTP_CURRENT_USER_IE_PROXY_CONFIG& ie_config); | 73 const WINHTTP_CURRENT_USER_IE_PROXY_CONFIG& ie_config); |
74 | 74 |
75 KeyEntryList keys_to_watch_; | 75 KeyEntryList keys_to_watch_; |
76 }; | 76 }; |
77 | 77 |
78 } // namespace net | 78 } // namespace net |
79 | 79 |
80 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ | 80 #endif // NET_PROXY_PROXY_CONFIG_SERVICE_WIN_H_ |
OLD | NEW |