1// Copyright (c) 2012 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.
4
5#ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H
6#define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H
7
8#include <string>
9
10#include "ash/ash_export.h"
11#include "base/strings/string16.h"
12
13namespace base {
14class DictionaryValue;
15}
16
17namespace chromeos {
18class NetworkTypePattern;
19}
20
21namespace ash {
22namespace network_connect {
23
24ASH_EXPORT extern const char kNetworkConnectNotificationId[];
25ASH_EXPORT extern const char kNetworkActivateNotificationId[];
26
27ASH_EXPORT extern const char kErrorActivateFailed[];
28
29// Requests a network connection and handles any errors and notifications.
30ASH_EXPORT void ConnectToNetwork(const std::string& service_path);
31
32// Enables or disables a network technology. If |technology| refers to cellular
33// and the device cannot be enabled due to a SIM lock, this function will
34// launch the SIM unlock dialog.
35ASH_EXPORT void SetTechnologyEnabled(
36    const chromeos::NetworkTypePattern& technology,
37    bool enabled_state);
38
39// Requests network activation and handles any errors and notifications.
40ASH_EXPORT void ActivateCellular(const std::string& service_path);
41
42// Determines whether or not a network requires a connection to activate or
43// setup and either shows a notification or opens the mobile setup dialog.
44ASH_EXPORT void ShowMobileSetup(const std::string& service_path);
45
46// Configures a network with a dictionary of Shill properties, then sends a
47// connect request. The profile is set according to 'shared' if allowed.
48ASH_EXPORT void ConfigureNetworkAndConnect(
49    const std::string& service_path,
50    const base::DictionaryValue& properties,
51    bool shared);
52
53// Requests a new network configuration to be created from a dictionary of
54// Shill properties and sends a connect request if the configuration succeeds.
55// The profile used is determined by |shared|.
56ASH_EXPORT void CreateConfigurationAndConnect(base::DictionaryValue* properties,
57                                              bool shared);
58
59// Requests a new network configuration to be created from a dictionary of
60// Shill properties. The profile used is determined by |shared|.
61ASH_EXPORT void CreateConfiguration(base::DictionaryValue* properties,
62                                    bool shared);
63
64// Returns the localized string for shill error string |error|.
65ASH_EXPORT base::string16 ErrorString(const std::string& error,
66                                      const std::string& service_path);
67
68// Shows the settings for the network specified by |service_path|. If empty,
69// or no matching network exists, shows the general internet settings page.
70ASH_EXPORT void ShowNetworkSettings(const std::string& service_path);
71
72}  // network_connect
73}  // ash
74
75#endif  // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H
76