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 EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ | 5 #ifndef EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ |
6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ | 6 #define EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/callback.h" | 11 #include "base/callback.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
16 #include "extensions/common/api/networking_private.h" | 16 #include "extensions/common/api/networking_private.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class BrowserContext; | 19 class BrowserContext; |
20 } | 20 } |
21 | 21 |
22 namespace extensions { | 22 namespace extensions { |
23 | 23 |
24 class NetworkingPrivateDelegateObserver; | 24 class NetworkingPrivateDelegateObserver; |
25 | 25 |
26 namespace core_api { | 26 namespace api { |
27 namespace networking_private { | 27 namespace networking_private { |
28 struct DeviceStateProperties; | 28 struct DeviceStateProperties; |
29 struct VerificationProperties; | 29 struct VerificationProperties; |
30 } // networking_private | 30 } // networking_private |
31 } // core_api | 31 } // api |
32 | 32 |
33 // Base class for platform dependent networkingPrivate API implementations. | 33 // Base class for platform dependent networkingPrivate API implementations. |
34 // All inputs and results for this class use ONC values. See | 34 // All inputs and results for this class use ONC values. See |
35 // networking_private.idl for descriptions of the expected inputs and results. | 35 // networking_private.idl for descriptions of the expected inputs and results. |
36 class NetworkingPrivateDelegate : public KeyedService { | 36 class NetworkingPrivateDelegate : public KeyedService { |
37 public: | 37 public: |
38 using DictionaryCallback = | 38 using DictionaryCallback = |
39 base::Callback<void(scoped_ptr<base::DictionaryValue>)>; | 39 base::Callback<void(scoped_ptr<base::DictionaryValue>)>; |
40 using VoidCallback = base::Callback<void()>; | 40 using VoidCallback = base::Callback<void()>; |
41 using BoolCallback = base::Callback<void(bool)>; | 41 using BoolCallback = base::Callback<void(bool)>; |
42 using StringCallback = base::Callback<void(const std::string&)>; | 42 using StringCallback = base::Callback<void(const std::string&)>; |
43 using NetworkListCallback = base::Callback<void(scoped_ptr<base::ListValue>)>; | 43 using NetworkListCallback = base::Callback<void(scoped_ptr<base::ListValue>)>; |
44 using FailureCallback = base::Callback<void(const std::string&)>; | 44 using FailureCallback = base::Callback<void(const std::string&)>; |
45 using DeviceStateList = | 45 using DeviceStateList = |
46 ScopedVector<core_api::networking_private::DeviceStateProperties>; | 46 ScopedVector<api::networking_private::DeviceStateProperties>; |
47 using VerificationProperties = | 47 using VerificationProperties = |
48 core_api::networking_private::VerificationProperties; | 48 api::networking_private::VerificationProperties; |
49 | 49 |
50 // The Verify* methods will be forwarded to a delegate implementation if | 50 // The Verify* methods will be forwarded to a delegate implementation if |
51 // provided, otherwise they will fail. A separate delegate it used so that the | 51 // provided, otherwise they will fail. A separate delegate it used so that the |
52 // current Verify* implementations are not exposed outside of src/chrome. | 52 // current Verify* implementations are not exposed outside of src/chrome. |
53 class VerifyDelegate { | 53 class VerifyDelegate { |
54 public: | 54 public: |
55 typedef NetworkingPrivateDelegate::VerificationProperties | 55 typedef NetworkingPrivateDelegate::VerificationProperties |
56 VerificationProperties; | 56 VerificationProperties; |
57 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback; | 57 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback; |
58 typedef NetworkingPrivateDelegate::StringCallback StringCallback; | 58 typedef NetworkingPrivateDelegate::StringCallback StringCallback; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 private: | 178 private: |
179 // Interface for Verify* methods. May be NULL. | 179 // Interface for Verify* methods. May be NULL. |
180 scoped_ptr<VerifyDelegate> verify_delegate_; | 180 scoped_ptr<VerifyDelegate> verify_delegate_; |
181 | 181 |
182 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); | 182 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); |
183 }; | 183 }; |
184 | 184 |
185 } // namespace extensions | 185 } // namespace extensions |
186 | 186 |
187 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_H_ | 187 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_H_ |
OLD | NEW |