OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ |
6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ | 6 #define CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
| 9 #include <vector> |
9 | 10 |
| 11 #include "chromeos/network/onc/onc_constants.h" |
10 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow | 12 #include "ui/gfx/native_widget_types.h" // gfx::NativeWindow |
11 | 13 |
| 14 namespace base { |
| 15 class DictionaryValue; |
| 16 } |
| 17 |
12 namespace chromeos { | 18 namespace chromeos { |
| 19 |
| 20 class NetworkState; |
| 21 |
13 namespace network_connect { | 22 namespace network_connect { |
14 | 23 |
15 enum ConnectResult { | |
16 NETWORK_NOT_FOUND, | |
17 CONNECT_NOT_STARTED, | |
18 CONNECT_STARTED | |
19 }; | |
20 | |
21 // Activate the cellular network associated with |service_path| if direct | |
22 // activation is supported, otherwise call ShowMobileSetup. | |
23 void ActivateCellular(const std::string& service_path); | |
24 | |
25 // Shows the mobile setup dialog which handles: | 24 // Shows the mobile setup dialog which handles: |
26 // * Activation for non direct-activation networks | 25 // * Activation for non direct-activation networks |
27 // * Showing network plan info | 26 // * Showing network plan info |
28 void ShowMobileSetup(const std::string& service_path); | 27 void ShowMobileSetup(const std::string& service_path); |
29 | 28 |
30 // Attempts to connect to the network specified by |service_path|. | 29 // Shows the network settings subpage for |service_path| (or the main |
31 // Returns one of the following results: | 30 // network settings page if empty). |
32 // NETWORK_NOT_FOUND if the network does not exist. | 31 void ShowNetworkSettings(const std::string& service_path); |
33 // CONNECT_NOT_STARTED if no connection attempt was started, e.g. because the | 32 |
34 // network is already connected, connecting, or activating. | 33 // Handle an unconfigured network: |
35 // CONNECT_STARTED if a connection attempt was started. | 34 // * Show the Configure dialog for wifi/wimax/VPN |
36 ConnectResult ConnectToNetwork(const std::string& service_path, | 35 // * Show the Activation, MobileSetup dialog, or settings page for cellular |
| 36 void HandleUnconfiguredNetwork(const std::string& service_path, |
37 gfx::NativeWindow parent_window); | 37 gfx::NativeWindow parent_window); |
38 | 38 |
39 // Handle an unconfigured network which might do any of the following: | 39 // If the network UIData has a matching enrollment URL, triggers the enrollment |
40 // * Configure and connect to the network with a matching cert but without | 40 // dialog and returns true. |
41 // pcks11id and tpm pin / slot configured. | 41 bool EnrollNetwork(const std::string& service_path, |
42 // * Show the enrollment dialog for the network. | 42 gfx::NativeWindow parent_window); |
43 // * Show the configuration dialog for the network. | 43 |
44 // * Show the activation dialog for the network. | 44 // Looks up the policy for |network| for the current active user and sets |
45 // * Show the settings UI for the network. | 45 // |onc_source| accordingly. |
46 void HandleUnconfiguredNetwork(const std::string& service_path, | 46 const base::DictionaryValue* FindPolicyForActiveUser( |
47 gfx::NativeWindow parent_window); | 47 const NetworkState* network, |
| 48 onc::ONCSource* onc_source); |
48 | 49 |
49 } // namespace network_connect | 50 } // namespace network_connect |
50 } // namespace chromeos | 51 } // namespace chromeos |
51 | 52 |
52 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ | 53 #endif // CHROME_BROWSER_CHROMEOS_OPTIONS_NETWORK_CONNECT_H_ |
OLD | NEW |