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
3 // found in the LICENSE file.
5 #include "extensions/browser/api/networking_private/networking_private_delegate.h"
7 #include "extensions/browser/api/networking_private/networking_private_api.h"
11 NetworkingPrivateDelegate::VerifyDelegate::VerifyDelegate() {
14 NetworkingPrivateDelegate::VerifyDelegate::~VerifyDelegate() {
17 NetworkingPrivateDelegate::NetworkingPrivateDelegate(
18 scoped_ptr
<VerifyDelegate
> verify_delegate
)
19 : verify_delegate_(verify_delegate
.Pass()) {
22 NetworkingPrivateDelegate::~NetworkingPrivateDelegate() {
25 void NetworkingPrivateDelegate::AddObserver(
26 NetworkingPrivateDelegateObserver
* observer
) {
27 NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
30 void NetworkingPrivateDelegate::RemoveObserver(
31 NetworkingPrivateDelegateObserver
* observer
) {
32 NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
35 void NetworkingPrivateDelegate::StartActivate(
36 const std::string
& guid
,
37 const std::string
& carrier
,
38 const VoidCallback
& success_callback
,
39 const FailureCallback
& failure_callback
) {
40 failure_callback
.Run(networking_private::kErrorNotSupported
);
43 void NetworkingPrivateDelegate::VerifyDestination(
44 const VerificationProperties
& verification_properties
,
45 const BoolCallback
& success_callback
,
46 const FailureCallback
& failure_callback
) {
47 if (!verify_delegate_
) {
48 failure_callback
.Run(networking_private::kErrorNotSupported
);
51 verify_delegate_
->VerifyDestination(verification_properties
, success_callback
,
55 void NetworkingPrivateDelegate::VerifyAndEncryptCredentials(
56 const std::string
& guid
,
57 const VerificationProperties
& verification_properties
,
58 const StringCallback
& success_callback
,
59 const FailureCallback
& failure_callback
) {
60 if (!verify_delegate_
) {
61 failure_callback
.Run(networking_private::kErrorNotSupported
);
64 verify_delegate_
->VerifyAndEncryptCredentials(
65 guid
, verification_properties
, success_callback
, failure_callback
);
68 void NetworkingPrivateDelegate::VerifyAndEncryptData(
69 const VerificationProperties
& verification_properties
,
70 const std::string
& data
,
71 const StringCallback
& success_callback
,
72 const FailureCallback
& failure_callback
) {
73 if (!verify_delegate_
) {
74 failure_callback
.Run(networking_private::kErrorNotSupported
);
77 verify_delegate_
->VerifyAndEncryptData(verification_properties
, data
,
78 success_callback
, failure_callback
);
81 } // namespace extensions