Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/singleton.h" | |
| 10 #include "chrome/browser/extensions/extension_function.h" | 11 #include "chrome/browser/extensions/extension_function.h" |
| 11 #include "net/proxy/proxy_config.h" | 12 #include "net/proxy/proxy_config.h" |
| 12 | 13 |
| 13 class DictionaryValue; | 14 class DictionaryValue; |
| 15 class ExtensionIOEventRouter; | |
| 16 | |
| 17 // This class observes proxy error events and routes them to the appropriate | |
| 18 // extensions listening to those events. All methods must be called on the IO | |
| 19 // thread unless otherwise specified. | |
| 20 class ExtensionProxyEventRouter { | |
|
Bernhard Bauer
2011/02/22 13:13:53
I guess this class is not used yet?
| |
| 21 public: | |
| 22 static ExtensionProxyEventRouter* GetInstance(); | |
| 23 | |
| 24 void OnProxyError(const ExtensionIOEventRouter* event_router, | |
| 25 int error_code); | |
| 26 | |
| 27 private: | |
| 28 friend struct DefaultSingletonTraits<ExtensionProxyEventRouter>; | |
| 29 | |
| 30 ExtensionProxyEventRouter(); | |
| 31 ~ExtensionProxyEventRouter(); | |
| 32 | |
| 33 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyEventRouter); | |
| 34 }; | |
| 14 | 35 |
| 15 class ProxySettingsFunction : public SyncExtensionFunction { | 36 class ProxySettingsFunction : public SyncExtensionFunction { |
| 16 public: | 37 public: |
| 17 virtual ~ProxySettingsFunction() {} | 38 virtual ~ProxySettingsFunction() {} |
| 18 virtual bool RunImpl() = 0; | 39 virtual bool RunImpl() = 0; |
| 19 protected: | 40 protected: |
| 20 // Takes ownership of |pref_value|. | 41 // Takes ownership of |pref_value|. |
| 21 void ApplyPreference( | 42 void ApplyPreference( |
| 22 const char* pref_path, Value* pref_value, bool incognito); | 43 const char* pref_path, Value* pref_value, bool incognito); |
| 23 void RemovePreference(const char* pref_path, bool incognito); | 44 void RemovePreference(const char* pref_path, bool incognito); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 // Convert the representation of a proxy configuration from the format | 96 // Convert the representation of a proxy configuration from the format |
| 76 // that is stored in the pref stores to the format that is used by the API. | 97 // that is stored in the pref stores to the format that is used by the API. |
| 77 // See ProxyServer type defined in |experimental.proxy|. | 98 // See ProxyServer type defined in |experimental.proxy|. |
| 78 bool ConvertToApiFormat(const DictionaryValue* proxy_prefs, | 99 bool ConvertToApiFormat(const DictionaryValue* proxy_prefs, |
| 79 DictionaryValue* api_proxy_config); | 100 DictionaryValue* api_proxy_config); |
| 80 bool ParseRules(const std::string& rules, DictionaryValue* out) const; | 101 bool ParseRules(const std::string& rules, DictionaryValue* out) const; |
| 81 DictionaryValue* ConvertToDictionary(const net::ProxyServer& proxy) const; | 102 DictionaryValue* ConvertToDictionary(const net::ProxyServer& proxy) const; |
| 82 }; | 103 }; |
| 83 | 104 |
| 84 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 105 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| OLD | NEW |