| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELE
GATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELE
GATE_H_ | 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "components/keyed_service/core/keyed_service.h" | 13 #include "components/keyed_service/core/keyed_service.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | |
| 17 class BrowserContext; | 16 class BrowserContext; |
| 18 | 17 } |
| 19 } // content | |
| 20 | 18 |
| 21 namespace extensions { | 19 namespace extensions { |
| 22 | 20 |
| 23 class NetworkingPrivateDelegateObserver; | 21 class NetworkingPrivateDelegateObserver; |
| 24 | 22 |
| 25 namespace api { | 23 namespace core_api { |
| 26 namespace networking_private { | 24 namespace networking_private { |
| 27 | |
| 28 struct VerificationProperties; | 25 struct VerificationProperties; |
| 29 | |
| 30 } // networking_private | 26 } // networking_private |
| 31 } // api | 27 } // core_api |
| 32 | 28 |
| 33 // Base class for platform dependent networkingPrivate API implementations. | 29 // Base class for platform dependent networkingPrivate API implementations. |
| 34 // All inputs and results for this class use ONC values. See | 30 // All inputs and results for this class use ONC values. See |
| 35 // networking_private.json for descriptions of the expected inputs and results. | 31 // networking_private.json for descriptions of the expected inputs and results. |
| 36 class NetworkingPrivateDelegate : public KeyedService { | 32 class NetworkingPrivateDelegate : public KeyedService { |
| 37 public: | 33 public: |
| 38 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> | 34 typedef base::Callback<void(scoped_ptr<base::DictionaryValue>)> |
| 39 DictionaryCallback; | 35 DictionaryCallback; |
| 40 typedef base::Callback<void()> VoidCallback; | 36 typedef base::Callback<void()> VoidCallback; |
| 41 typedef base::Callback<void(bool)> BoolCallback; | 37 typedef base::Callback<void(bool)> BoolCallback; |
| 42 typedef base::Callback<void(const std::string&)> StringCallback; | 38 typedef base::Callback<void(const std::string&)> StringCallback; |
| 43 typedef base::Callback<void(scoped_ptr<base::ListValue>)> NetworkListCallback; | 39 typedef base::Callback<void(scoped_ptr<base::ListValue>)> NetworkListCallback; |
| 44 typedef base::Callback<void(const std::string&)> FailureCallback; | 40 typedef base::Callback<void(const std::string&)> FailureCallback; |
| 45 typedef api::networking_private::VerificationProperties | 41 typedef core_api::networking_private::VerificationProperties |
| 46 VerificationProperties; | 42 VerificationProperties; |
| 47 | 43 |
| 48 // The Verify* methods will be forwarded to a delegate implementation if | 44 // The Verify* methods will be forwarded to a delegate implementation if |
| 49 // provided, otherwise they will fail. A separate delegate it used so that the | 45 // provided, otherwise they will fail. A separate delegate it used so that the |
| 50 // current Verify* implementations are not exposed outside of src/chrome. | 46 // current Verify* implementations are not exposed outside of src/chrome. |
| 51 class VerifyDelegate { | 47 class VerifyDelegate { |
| 52 public: | 48 public: |
| 53 typedef NetworkingPrivateDelegate::VerificationProperties | 49 typedef NetworkingPrivateDelegate::VerificationProperties |
| 54 VerificationProperties; | 50 VerificationProperties; |
| 55 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback; | 51 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 | 161 |
| 166 private: | 162 private: |
| 167 // Interface for Verify* methods. May be NULL. | 163 // Interface for Verify* methods. May be NULL. |
| 168 scoped_ptr<VerifyDelegate> verify_delegate_; | 164 scoped_ptr<VerifyDelegate> verify_delegate_; |
| 169 | 165 |
| 170 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); | 166 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); |
| 171 }; | 167 }; |
| 172 | 168 |
| 173 } // namespace extensions | 169 } // namespace extensions |
| 174 | 170 |
| 175 #endif // CHROME_BROWSER_EXTENSIONS_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_D
ELEGATE_H_ | 171 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_H_ |
| OLD | NEW |