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.
5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H
10 #include "ash/ash_export.h"
11 #include "base/strings/string16.h"
12 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow
15 class DictionaryValue
;
19 class NetworkTypePattern
;
23 namespace network_connect
{
25 ASH_EXPORT
extern const char kNetworkConnectNotificationId
[];
26 ASH_EXPORT
extern const char kNetworkActivateNotificationId
[];
28 ASH_EXPORT
extern const char kErrorActivateFailed
[];
30 // Requests a network connection and handles any errors and notifications.
31 // |parent_window| is used to parent any UI on failure (e.g. for certificate
32 // enrollment). If NULL, the default window will be used.
33 ASH_EXPORT
void ConnectToNetwork(const std::string
& service_path
,
34 gfx::NativeWindow parent_window
);
36 // Enables or disables a network technology. If |technology| refers to cellular
37 // and the device cannot be enabled due to a SIM lock, this function will
38 // launch the SIM unlock dialog.
39 ASH_EXPORT
void SetTechnologyEnabled(
40 const chromeos::NetworkTypePattern
& technology
,
43 // Requests network activation and handles any errors and notifications.
44 ASH_EXPORT
void ActivateCellular(const std::string
& service_path
);
46 // Determines whether or not a network requires a connection to activate or
47 // setup and either shows a notification or opens the mobile setup dialog.
48 ASH_EXPORT
void ShowMobileSetup(const std::string
& service_path
);
50 // Configures a network with a dictionary of Shill properties, then sends a
51 // connect request. The profile is set according to 'shared' if allowed.
52 ASH_EXPORT
void ConfigureNetworkAndConnect(
53 const std::string
& service_path
,
54 const base::DictionaryValue
& properties
,
57 // Requests a new network configuration to be created from a dictionary of
58 // Shill properties and sends a connect request if the configuration succeeds.
59 // The profile used is determined by |shared|.
60 ASH_EXPORT
void CreateConfigurationAndConnect(base::DictionaryValue
* properties
,
63 // Requests a new network configuration to be created from a dictionary of
64 // Shill properties. The profile used is determined by |shared|.
65 ASH_EXPORT
void CreateConfiguration(base::DictionaryValue
* properties
,
68 // Returns the localized string for shill error string |error|.
69 ASH_EXPORT
base::string16
ErrorString(const std::string
& error
,
70 const std::string
& service_path
);
72 // Shows the settings for the network specified by |service_path|. If empty,
73 // or no matching network exists, shows the general internet settings page.
74 ASH_EXPORT
void ShowNetworkSettings(const std::string
& service_path
);
79 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H