- add sources.
[platform/framework/web/crosswalk.git] / src / ash / system / chromeos / network / network_connect.h
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 #include "ui/gfx/native_widget_types.h"  // gfx::NativeWindow
13
14 namespace base {
15 class DictionaryValue;
16 }
17
18 namespace chromeos {
19 class NetworkTypePattern;
20 }
21
22 namespace ash {
23 namespace network_connect {
24
25 ASH_EXPORT extern const char kNetworkConnectNotificationId[];
26 ASH_EXPORT extern const char kNetworkActivateNotificationId[];
27
28 ASH_EXPORT extern const char kErrorActivateFailed[];
29
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);
35
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,
41     bool enabled_state);
42
43 // Requests network activation and handles any errors and notifications.
44 ASH_EXPORT void ActivateCellular(const std::string& service_path);
45
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);
49
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,
55     bool shared);
56
57 // Requests a new network configuration to be created from a dictionary of
58 // Shill properties. The profile used is determined by |shared|.
59 ASH_EXPORT void CreateConfigurationAndConnect(base::DictionaryValue* properties,
60                                               bool shared);
61
62 // Returns the localized string for shill error string |error|.
63 ASH_EXPORT base::string16 ErrorString(const std::string& error,
64                                       const std::string& service_path);
65
66 // Shows the settings for the network specified by |service_path|. If empty,
67 // or no matching network exists, shows the general internet settings page.
68 ASH_EXPORT void ShowNetworkSettings(const std::string& service_path);
69
70 }  // network_connect
71 }  // ash
72
73 #endif  // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H