Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / extensions / browser / api / networking_private / networking_private_delegate.cc
blob6a4c04801abbc20bf3048aa04ffe907d770f8eb6
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"
9 namespace extensions {
11 NetworkingPrivateDelegate::VerifyDelegate::VerifyDelegate() {
14 NetworkingPrivateDelegate::VerifyDelegate::~VerifyDelegate() {
17 NetworkingPrivateDelegate::UIDelegate::UIDelegate() {}
19 NetworkingPrivateDelegate::UIDelegate::~UIDelegate() {}
21 NetworkingPrivateDelegate::NetworkingPrivateDelegate(
22 scoped_ptr<VerifyDelegate> verify_delegate)
23 : verify_delegate_(verify_delegate.Pass()) {
26 NetworkingPrivateDelegate::~NetworkingPrivateDelegate() {
29 void NetworkingPrivateDelegate::AddObserver(
30 NetworkingPrivateDelegateObserver* observer) {
31 NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
34 void NetworkingPrivateDelegate::RemoveObserver(
35 NetworkingPrivateDelegateObserver* observer) {
36 NOTREACHED() << "Class does not use NetworkingPrivateDelegateObserver";
39 void NetworkingPrivateDelegate::StartActivate(
40 const std::string& guid,
41 const std::string& carrier,
42 const VoidCallback& success_callback,
43 const FailureCallback& failure_callback) {
44 failure_callback.Run(networking_private::kErrorNotSupported);
47 void NetworkingPrivateDelegate::VerifyDestination(
48 const VerificationProperties& verification_properties,
49 const BoolCallback& success_callback,
50 const FailureCallback& failure_callback) {
51 if (!verify_delegate_) {
52 failure_callback.Run(networking_private::kErrorNotSupported);
53 return;
55 verify_delegate_->VerifyDestination(verification_properties, success_callback,
56 failure_callback);
59 void NetworkingPrivateDelegate::VerifyAndEncryptCredentials(
60 const std::string& guid,
61 const VerificationProperties& verification_properties,
62 const StringCallback& success_callback,
63 const FailureCallback& failure_callback) {
64 if (!verify_delegate_) {
65 failure_callback.Run(networking_private::kErrorNotSupported);
66 return;
68 verify_delegate_->VerifyAndEncryptCredentials(
69 guid, verification_properties, success_callback, failure_callback);
72 void NetworkingPrivateDelegate::VerifyAndEncryptData(
73 const VerificationProperties& verification_properties,
74 const std::string& data,
75 const StringCallback& success_callback,
76 const FailureCallback& failure_callback) {
77 if (!verify_delegate_) {
78 failure_callback.Run(networking_private::kErrorNotSupported);
79 return;
81 verify_delegate_->VerifyAndEncryptData(verification_properties, data,
82 success_callback, failure_callback);
85 } // namespace extensions