| 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 // Defines the Chrome Extensions Proxy Settings API relevant classes to realize | 5 // Defines the Chrome Extensions Proxy Settings API relevant classes to realize |
| 6 // the API as specified in chrome/common/extensions/api/extension_api.json. | 6 // the API as specified in chrome/common/extensions/api/extension_api.json. |
| 7 | 7 |
| 8 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 8 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| 9 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 9 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| 10 | 10 |
| 11 #include <string> | 11 #include <string> |
| 12 | 12 |
| 13 #include "base/memory/singleton.h" | 13 #include "base/memory/singleton.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "chrome/browser/extensions/extension_preference_api.h" | 15 #include "chrome/browser/extensions/extension_preference_api.h" |
| 16 #include "chrome/browser/prefs/proxy_prefs.h" | 16 #include "chrome/browser/prefs/proxy_prefs.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 | 18 |
| 19 class ExtensionEventRouterForwarder; |
| 20 |
| 21 namespace base { |
| 19 class Value; | 22 class Value; |
| 20 class ExtensionEventRouterForwarder; | 23 } |
| 21 | 24 |
| 22 // Class to convert between the representation of proxy settings used | 25 // Class to convert between the representation of proxy settings used |
| 23 // in the Proxy Settings API and the representation used in the PrefStores. | 26 // in the Proxy Settings API and the representation used in the PrefStores. |
| 24 // This plugs into the ExtensionPreferenceAPI to get and set proxy settings. | 27 // This plugs into the ExtensionPreferenceAPI to get and set proxy settings. |
| 25 class ProxyPrefTransformer : public PrefTransformerInterface { | 28 class ProxyPrefTransformer : public PrefTransformerInterface { |
| 26 public: | 29 public: |
| 27 ProxyPrefTransformer(); | 30 ProxyPrefTransformer(); |
| 28 virtual ~ProxyPrefTransformer(); | 31 virtual ~ProxyPrefTransformer(); |
| 29 | 32 |
| 30 // Implementation of PrefTransformerInterface. | 33 // Implementation of PrefTransformerInterface. |
| 31 virtual Value* ExtensionToBrowserPref(const Value* extension_pref, | 34 virtual base::Value* ExtensionToBrowserPref(const base::Value* extension_pref, |
| 32 std::string* error, | 35 std::string* error, |
| 33 bool* bad_message) OVERRIDE; | 36 bool* bad_message) OVERRIDE; |
| 34 virtual Value* BrowserToExtensionPref(const Value* browser_pref) OVERRIDE; | 37 virtual base::Value* BrowserToExtensionPref( |
| 38 const base::Value* browser_pref) OVERRIDE; |
| 35 | 39 |
| 36 private: | 40 private: |
| 37 DISALLOW_COPY_AND_ASSIGN(ProxyPrefTransformer); | 41 DISALLOW_COPY_AND_ASSIGN(ProxyPrefTransformer); |
| 38 }; | 42 }; |
| 39 | 43 |
| 40 // This class observes proxy error events and routes them to the appropriate | 44 // This class observes proxy error events and routes them to the appropriate |
| 41 // extensions listening to those events. All methods must be called on the IO | 45 // extensions listening to those events. All methods must be called on the IO |
| 42 // thread unless otherwise specified. | 46 // thread unless otherwise specified. |
| 43 class ExtensionProxyEventRouter { | 47 class ExtensionProxyEventRouter { |
| 44 public: | 48 public: |
| (...skipping 11 matching lines...) Expand all Loading... |
| 56 private: | 60 private: |
| 57 friend struct DefaultSingletonTraits<ExtensionProxyEventRouter>; | 61 friend struct DefaultSingletonTraits<ExtensionProxyEventRouter>; |
| 58 | 62 |
| 59 ExtensionProxyEventRouter(); | 63 ExtensionProxyEventRouter(); |
| 60 ~ExtensionProxyEventRouter(); | 64 ~ExtensionProxyEventRouter(); |
| 61 | 65 |
| 62 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyEventRouter); | 66 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyEventRouter); |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 69 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| OLD | NEW |