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 <memory> | 8 #include <memory> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 DISALLOW_COPY_AND_ASSIGN(UIDelegate); | 97 DISALLOW_COPY_AND_ASSIGN(UIDelegate); |
98 }; | 98 }; |
99 | 99 |
100 // If |verify_delegate| is not NULL, the Verify* methods will be forwarded | 100 // If |verify_delegate| is not NULL, the Verify* methods will be forwarded |
101 // to the delegate. Otherwise they will fail with a NotSupported error. | 101 // to the delegate. Otherwise they will fail with a NotSupported error. |
102 explicit NetworkingPrivateDelegate( | 102 explicit NetworkingPrivateDelegate( |
103 std::unique_ptr<VerifyDelegate> verify_delegate); | 103 std::unique_ptr<VerifyDelegate> verify_delegate); |
104 ~NetworkingPrivateDelegate() override; | 104 ~NetworkingPrivateDelegate() override; |
105 | 105 |
106 void set_ui_delegate(std::unique_ptr<UIDelegate> ui_delegate) { | 106 void set_ui_delegate(std::unique_ptr<UIDelegate> ui_delegate) { |
107 ui_delegate_.reset(ui_delegate.release()); | 107 ui_delegate_ = std::move(ui_delegate); |
108 } | 108 } |
109 | 109 |
110 const UIDelegate* ui_delegate() { return ui_delegate_.get(); } | 110 const UIDelegate* ui_delegate() { return ui_delegate_.get(); } |
111 | 111 |
112 // Asynchronous methods | 112 // Asynchronous methods |
113 virtual void GetProperties(const std::string& guid, | 113 virtual void GetProperties(const std::string& guid, |
114 const DictionaryCallback& success_callback, | 114 const DictionaryCallback& success_callback, |
115 const FailureCallback& failure_callback) = 0; | 115 const FailureCallback& failure_callback) = 0; |
116 virtual void GetManagedProperties( | 116 virtual void GetManagedProperties( |
117 const std::string& guid, | 117 const std::string& guid, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 | 216 |
217 // Interface for UI methods. May be null. | 217 // Interface for UI methods. May be null. |
218 std::unique_ptr<UIDelegate> ui_delegate_; | 218 std::unique_ptr<UIDelegate> ui_delegate_; |
219 | 219 |
220 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); | 220 DISALLOW_COPY_AND_ASSIGN(NetworkingPrivateDelegate); |
221 }; | 221 }; |
222 | 222 |
223 } // namespace extensions | 223 } // namespace extensions |
224 | 224 |
225 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_H_ | 225 #endif // EXTENSIONS_BROWSER_API_NETWORKING_PRIVATE_NETWORKING_PRIVATE_DELEGATE
_H_ |
OLD | NEW |