forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
network_activation_handler.h
54 lines (43 loc) · 1.97 KB
/
network_activation_handler.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_
#define CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_
#include <string>
#include "base/component_export.h"
#include "base/macros.h"
#include "chromeos/network/network_handler_callbacks.h"
namespace chromeos {
// The NetworkActivationHandler class allows making service specific
// calls required for activation on mobile networks.
class COMPONENT_EXPORT(CHROMEOS_NETWORK) NetworkActivationHandler {
public:
virtual ~NetworkActivationHandler() = default;
// ActivateNetwork() will start an asynchronous activation attempt.
// |carrier| may be empty or may specify a carrier to activate.
// On success, |success_callback| will be called.
// On failure, |error_callback| will be called with |error_name| one of:
// kErrorNotFound if no network matching |service_path| is found.
// kErrorShillError if a DBus or Shill error occurred.
virtual void Activate(
const std::string& service_path,
const std::string& carrier,
const base::Closure& success_callback,
const network_handler::ErrorCallback& error_callback) = 0;
// CompleteActivation() will start an asynchronous activation completion
// attempt.
// On success, |success_callback| will be called.
// On failure, |error_callback| will be called with |error_name| one of:
// kErrorNotFound if no network matching |service_path| is found.
// kErrorShillError if a DBus or Shill error occurred.
virtual void CompleteActivation(
const std::string& service_path,
const base::Closure& success_callback,
const network_handler::ErrorCallback& error_callback) = 0;
protected:
NetworkActivationHandler() = default;
private:
DISALLOW_COPY_AND_ASSIGN(NetworkActivationHandler);
};
} // namespace chromeos
#endif // CHROMEOS_NETWORK_NETWORK_ACTIVATION_HANDLER_H_