Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(306)

Side by Side Diff: extensions/browser/api/networking_private/networking_private_delegate.h

Issue 1779633002: Invoke createNetwork() callback with GUID, not service name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pass both service_path and guid arguments to all callbacks Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
(...skipping 19 matching lines...) Expand all
30 // Base class for platform dependent networkingPrivate API implementations. 30 // Base class for platform dependent networkingPrivate API implementations.
31 // All inputs and results for this class use ONC values. See 31 // All inputs and results for this class use ONC values. See
32 // networking_private.idl for descriptions of the expected inputs and results. 32 // networking_private.idl for descriptions of the expected inputs and results.
33 class NetworkingPrivateDelegate : public KeyedService { 33 class NetworkingPrivateDelegate : public KeyedService {
34 public: 34 public:
35 using DictionaryCallback = 35 using DictionaryCallback =
36 base::Callback<void(scoped_ptr<base::DictionaryValue>)>; 36 base::Callback<void(scoped_ptr<base::DictionaryValue>)>;
37 using VoidCallback = base::Callback<void()>; 37 using VoidCallback = base::Callback<void()>;
38 using BoolCallback = base::Callback<void(bool)>; 38 using BoolCallback = base::Callback<void(bool)>;
39 using StringCallback = base::Callback<void(const std::string&)>; 39 using StringCallback = base::Callback<void(const std::string&)>;
40 using ServiceCallback =
41 base::Callback<void(const std::string&, const std::string&)>;
stevenjb 2016/03/10 01:49:10 'ServiceCallback' isn't very meaningful in this co
Kevin Cernekee 2016/03/11 01:53:57 Done.
40 using NetworkListCallback = base::Callback<void(scoped_ptr<base::ListValue>)>; 42 using NetworkListCallback = base::Callback<void(scoped_ptr<base::ListValue>)>;
41 using FailureCallback = base::Callback<void(const std::string&)>; 43 using FailureCallback = base::Callback<void(const std::string&)>;
42 using DeviceStateList = 44 using DeviceStateList =
43 std::vector<scoped_ptr<api::networking_private::DeviceStateProperties>>; 45 std::vector<scoped_ptr<api::networking_private::DeviceStateProperties>>;
44 using VerificationProperties = 46 using VerificationProperties =
45 api::networking_private::VerificationProperties; 47 api::networking_private::VerificationProperties;
46 48
47 // The Verify* methods will be forwarded to a delegate implementation if 49 // The Verify* methods will be forwarded to a delegate implementation if
48 // provided, otherwise they will fail. A separate delegate it used so that the 50 // provided, otherwise they will fail. A separate delegate it used so that the
49 // current Verify* implementations are not exposed outside of src/chrome. 51 // current Verify* implementations are not exposed outside of src/chrome.
50 class VerifyDelegate { 52 class VerifyDelegate {
51 public: 53 public:
52 typedef NetworkingPrivateDelegate::VerificationProperties 54 typedef NetworkingPrivateDelegate::VerificationProperties
53 VerificationProperties; 55 VerificationProperties;
54 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback; 56 typedef NetworkingPrivateDelegate::BoolCallback BoolCallback;
55 typedef NetworkingPrivateDelegate::StringCallback StringCallback; 57 typedef NetworkingPrivateDelegate::StringCallback StringCallback;
58 typedef NetworkingPrivateDelegate::ServiceCallback ServiceCallback;
56 typedef NetworkingPrivateDelegate::FailureCallback FailureCallback; 59 typedef NetworkingPrivateDelegate::FailureCallback FailureCallback;
57 60
58 VerifyDelegate(); 61 VerifyDelegate();
59 virtual ~VerifyDelegate(); 62 virtual ~VerifyDelegate();
60 63
61 virtual void VerifyDestination( 64 virtual void VerifyDestination(
62 const VerificationProperties& verification_properties, 65 const VerificationProperties& verification_properties,
63 const BoolCallback& success_callback, 66 const BoolCallback& success_callback,
64 const FailureCallback& failure_callback) = 0; 67 const FailureCallback& failure_callback) = 0;
65 virtual void VerifyAndEncryptCredentials( 68 virtual void VerifyAndEncryptCredentials(
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 const FailureCallback& failure_callback) = 0; 121 const FailureCallback& failure_callback) = 0;
119 virtual void GetState(const std::string& guid, 122 virtual void GetState(const std::string& guid,
120 const DictionaryCallback& success_callback, 123 const DictionaryCallback& success_callback,
121 const FailureCallback& failure_callback) = 0; 124 const FailureCallback& failure_callback) = 0;
122 virtual void SetProperties(const std::string& guid, 125 virtual void SetProperties(const std::string& guid,
123 scoped_ptr<base::DictionaryValue> properties, 126 scoped_ptr<base::DictionaryValue> properties,
124 const VoidCallback& success_callback, 127 const VoidCallback& success_callback,
125 const FailureCallback& failure_callback) = 0; 128 const FailureCallback& failure_callback) = 0;
126 virtual void CreateNetwork(bool shared, 129 virtual void CreateNetwork(bool shared,
127 scoped_ptr<base::DictionaryValue> properties, 130 scoped_ptr<base::DictionaryValue> properties,
128 const StringCallback& success_callback, 131 const ServiceCallback& success_callback,
129 const FailureCallback& failure_callback) = 0; 132 const FailureCallback& failure_callback) = 0;
130 virtual void ForgetNetwork(const std::string& guid, 133 virtual void ForgetNetwork(const std::string& guid,
131 const VoidCallback& success_callback, 134 const VoidCallback& success_callback,
132 const FailureCallback& failure_callback) = 0; 135 const FailureCallback& failure_callback) = 0;
133 virtual void GetNetworks(const std::string& network_type, 136 virtual void GetNetworks(const std::string& network_type,
134 bool configured_only, 137 bool configured_only,
135 bool visible_only, 138 bool visible_only,
136 int limit, 139 int limit,
137 const NetworkListCallback& success_callback, 140 const NetworkListCallback& success_callback,
138 const FailureCallback& failure_callback) = 0; 141 const FailureCallback& failure_callback) = 0;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 218
216 // Interface for UI methods. May be null. 219 // Interface for UI methods. May be null.
217 scoped_ptr<UIDelegate> ui_delegate_; 220 scoped_ptr<UIDelegate> ui_delegate_;
218 221
219 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); 222 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate);
220 }; 223 };
221 224
222 } // namespace extensions 225 } // namespace extensions
223 226
224 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE _H_ 227 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698