OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H | 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H |
6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H | 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
12 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow | 12 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow |
13 | 13 |
14 namespace base { | 14 namespace base { |
15 class DictionaryValue; | 15 class DictionaryValue; |
16 } | 16 } |
17 | 17 |
18 namespace ash { | 18 namespace ash { |
19 namespace network_connect { | 19 namespace network_connect { |
20 | 20 |
| 21 ASH_EXPORT extern const char kErrorActivateFailed[]; |
| 22 |
21 // Requests a network connection and handles any errors and notifications. | 23 // Requests a network connection and handles any errors and notifications. |
22 // |owning_window| is used to parent any UI on failure (e.g. for certificate | 24 // |owning_window| is used to parent any UI on failure (e.g. for certificate |
23 // enrollment). If NULL, the default window will be used. | 25 // enrollment). If NULL, the default window will be used. |
24 ASH_EXPORT void ConnectToNetwork(const std::string& service_path, | 26 ASH_EXPORT void ConnectToNetwork(const std::string& service_path, |
25 gfx::NativeWindow owning_window); | 27 gfx::NativeWindow owning_window); |
26 | 28 |
27 // Requests network activation and handles any errors and notifications. | 29 // Requests network activation and handles any errors and notifications. |
28 ASH_EXPORT void ActivateCellular(const std::string& service_path); | 30 ASH_EXPORT void ActivateCellular(const std::string& service_path); |
29 | 31 |
30 // Configures a network with a dictionary of Shill properties, then sends a | 32 // Configures a network with a dictionary of Shill properties, then sends a |
31 // connect request. The profile is set according to 'shared' if allowed. | 33 // connect request. The profile is set according to 'shared' if allowed. |
32 ASH_EXPORT void ConfigureNetworkAndConnect( | 34 ASH_EXPORT void ConfigureNetworkAndConnect( |
33 const std::string& service_path, | 35 const std::string& service_path, |
34 const base::DictionaryValue& properties, | 36 const base::DictionaryValue& properties, |
35 bool shared); | 37 bool shared); |
36 | 38 |
37 // Requests a new network configuration to be created from a dictionary of | 39 // Requests a new network configuration to be created from a dictionary of |
38 // Shill properties. The profile used is determined by |shared|. | 40 // Shill properties. The profile used is determined by |shared|. |
39 ASH_EXPORT void CreateConfigurationAndConnect(base::DictionaryValue* properties, | 41 ASH_EXPORT void CreateConfigurationAndConnect(base::DictionaryValue* properties, |
40 bool shared); | 42 bool shared); |
41 | 43 |
42 // Returns the localized string for shill error string |error|. | 44 // Returns the localized string for shill error string |error|. |
43 ASH_EXPORT base::string16 ErrorString(const std::string& error); | 45 ASH_EXPORT base::string16 ErrorString(const std::string& error); |
44 | 46 |
45 } // network_connect | 47 } // network_connect |
46 } // ash | 48 } // ash |
47 | 49 |
48 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H | 50 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_CONNECT_H |
OLD | NEW |