| 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" | |
| 18 | 17 |
| 19 class ExtensionEventRouterForwarder; | 18 class ExtensionEventRouterForwarder; |
| 20 | 19 |
| 21 namespace base { | 20 namespace base { |
| 22 class Value; | 21 class Value; |
| 23 } | 22 } |
| 24 | 23 |
| 25 // Class to convert between the representation of proxy settings used | 24 // Class to convert between the representation of proxy settings used |
| 26 // in the Proxy Settings API and the representation used in the PrefStores. | 25 // in the Proxy Settings API and the representation used in the PrefStores. |
| 27 // This plugs into the ExtensionPreferenceAPI to get and set proxy settings. | 26 // This plugs into the ExtensionPreferenceAPI to get and set proxy settings. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 42 }; | 41 }; |
| 43 | 42 |
| 44 // This class observes proxy error events and routes them to the appropriate | 43 // This class observes proxy error events and routes them to the appropriate |
| 45 // extensions listening to those events. All methods must be called on the IO | 44 // extensions listening to those events. All methods must be called on the IO |
| 46 // thread unless otherwise specified. | 45 // thread unless otherwise specified. |
| 47 class ExtensionProxyEventRouter { | 46 class ExtensionProxyEventRouter { |
| 48 public: | 47 public: |
| 49 static ExtensionProxyEventRouter* GetInstance(); | 48 static ExtensionProxyEventRouter* GetInstance(); |
| 50 | 49 |
| 51 void OnProxyError(ExtensionEventRouterForwarder* event_router, | 50 void OnProxyError(ExtensionEventRouterForwarder* event_router, |
| 52 ProfileId profile_id, | 51 void* profile, |
| 53 int error_code); | 52 int error_code); |
| 54 | 53 |
| 55 void OnPACScriptError(ExtensionEventRouterForwarder* event_router, | 54 void OnPACScriptError(ExtensionEventRouterForwarder* event_router, |
| 56 ProfileId profile_id, | 55 void* profile, |
| 57 int line_number, | 56 int line_number, |
| 58 const string16& error); | 57 const string16& error); |
| 59 | 58 |
| 60 private: | 59 private: |
| 61 friend struct DefaultSingletonTraits<ExtensionProxyEventRouter>; | 60 friend struct DefaultSingletonTraits<ExtensionProxyEventRouter>; |
| 62 | 61 |
| 63 ExtensionProxyEventRouter(); | 62 ExtensionProxyEventRouter(); |
| 64 ~ExtensionProxyEventRouter(); | 63 ~ExtensionProxyEventRouter(); |
| 65 | 64 |
| 66 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyEventRouter); | 65 DISALLOW_COPY_AND_ASSIGN(ExtensionProxyEventRouter); |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ | 68 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_PROXY_API_H_ |
| OLD | NEW |