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 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/internet_options_handler.h" |
6 | 6 |
7 #include <ctype.h> | 7 #include <ctype.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "base/time/time.h" | 28 #include "base/time/time.h" |
29 #include "base/values.h" | 29 #include "base/values.h" |
30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/chrome_notification_types.h" | 31 #include "chrome/browser/chrome_notification_types.h" |
32 #include "chrome/browser/chromeos/choose_mobile_network_dialog.h" | 32 #include "chrome/browser/chromeos/choose_mobile_network_dialog.h" |
33 #include "chrome/browser/chromeos/cros/network_property_ui_data.h" | 33 #include "chrome/browser/chromeos/cros/network_property_ui_data.h" |
34 #include "chrome/browser/chromeos/enrollment_dialog_view.h" | 34 #include "chrome/browser/chromeos/enrollment_dialog_view.h" |
35 #include "chrome/browser/chromeos/login/user.h" | 35 #include "chrome/browser/chromeos/login/user.h" |
36 #include "chrome/browser/chromeos/login/user_manager.h" | 36 #include "chrome/browser/chromeos/login/user_manager.h" |
37 #include "chrome/browser/chromeos/mobile_config.h" | 37 #include "chrome/browser/chromeos/mobile_config.h" |
| 38 #include "chrome/browser/chromeos/net/onc_utils.h" |
38 #include "chrome/browser/chromeos/options/network_config_view.h" | 39 #include "chrome/browser/chromeos/options/network_config_view.h" |
39 #include "chrome/browser/chromeos/options/network_connect.h" | |
40 #include "chrome/browser/chromeos/settings/cros_settings.h" | 40 #include "chrome/browser/chromeos/settings/cros_settings.h" |
41 #include "chrome/browser/chromeos/sim_dialog_delegate.h" | 41 #include "chrome/browser/chromeos/sim_dialog_delegate.h" |
42 #include "chrome/browser/chromeos/ui_proxy_config_service.h" | 42 #include "chrome/browser/chromeos/ui_proxy_config_service.h" |
43 #include "chrome/browser/profiles/profile_manager.h" | 43 #include "chrome/browser/profiles/profile_manager.h" |
44 #include "chrome/browser/ui/browser.h" | 44 #include "chrome/browser/ui/browser.h" |
45 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
46 #include "chrome/browser/ui/browser_window.h" | 46 #include "chrome/browser/ui/browser_window.h" |
47 #include "chrome/browser/ui/host_desktop.h" | 47 #include "chrome/browser/ui/host_desktop.h" |
48 #include "chrome/browser/ui/singleton_tabs.h" | 48 #include "chrome/browser/ui/singleton_tabs.h" |
49 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" | 49 #include "chrome/browser/ui/webui/options/chromeos/core_chromeos_options_handler
.h" |
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 provider_properties->GetStringWithoutPathExpansion( | 646 provider_properties->GetStringWithoutPathExpansion( |
647 flimflam::kOpenVPNUserProperty, &username); | 647 flimflam::kOpenVPNUserProperty, &username); |
648 } else { | 648 } else { |
649 provider_properties->GetStringWithoutPathExpansion( | 649 provider_properties->GetStringWithoutPathExpansion( |
650 flimflam::kL2tpIpsecUserProperty, &username); | 650 flimflam::kL2tpIpsecUserProperty, &username); |
651 } | 651 } |
652 dictionary->SetString(kTagUsername, username); | 652 dictionary->SetString(kTagUsername, username); |
653 | 653 |
654 onc::ONCSource onc_source = onc::ONC_SOURCE_NONE; | 654 onc::ONCSource onc_source = onc::ONC_SOURCE_NONE; |
655 const base::DictionaryValue* onc = | 655 const base::DictionaryValue* onc = |
656 network_connect::FindPolicyForActiveUser(vpn, &onc_source); | 656 onc::FindPolicyForActiveUser(vpn->guid(), &onc_source); |
657 | 657 |
658 NetworkPropertyUIData hostname_ui_data; | 658 NetworkPropertyUIData hostname_ui_data; |
659 hostname_ui_data.ParseOncProperty( | 659 hostname_ui_data.ParseOncProperty( |
660 onc_source, | 660 onc_source, |
661 onc, | 661 onc, |
662 base::StringPrintf("%s.%s", onc::network_config::kVPN, onc::vpn::kHost)); | 662 base::StringPrintf("%s.%s", onc::network_config::kVPN, onc::vpn::kHost)); |
663 std::string provider_host; | 663 std::string provider_host; |
664 provider_properties->GetStringWithoutPathExpansion( | 664 provider_properties->GetStringWithoutPathExpansion( |
665 flimflam::kHostProperty, &provider_host); | 665 flimflam::kHostProperty, &provider_host); |
666 SetValueDictionary(dictionary, kTagServerHostname, | 666 SetValueDictionary(dictionary, kTagServerHostname, |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 | 1092 |
1093 void InternetOptionsHandler::ShowMorePlanInfoCallback( | 1093 void InternetOptionsHandler::ShowMorePlanInfoCallback( |
1094 const base::ListValue* args) { | 1094 const base::ListValue* args) { |
1095 if (!web_ui()) | 1095 if (!web_ui()) |
1096 return; | 1096 return; |
1097 std::string service_path; | 1097 std::string service_path; |
1098 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) { | 1098 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) { |
1099 NOTREACHED(); | 1099 NOTREACHED(); |
1100 return; | 1100 return; |
1101 } | 1101 } |
1102 network_connect::ShowMobileSetup(service_path); | 1102 ash::network_connect::ShowMobileSetup(service_path); |
1103 } | 1103 } |
1104 | 1104 |
1105 void InternetOptionsHandler::BuyDataPlanCallback(const base::ListValue* args) { | 1105 void InternetOptionsHandler::BuyDataPlanCallback(const base::ListValue* args) { |
1106 if (!web_ui()) | 1106 if (!web_ui()) |
1107 return; | 1107 return; |
1108 std::string service_path; | 1108 std::string service_path; |
1109 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) { | 1109 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) { |
1110 NOTREACHED(); | 1110 NOTREACHED(); |
1111 return; | 1111 return; |
1112 } | 1112 } |
1113 network_connect::ShowMobileSetup(service_path); | 1113 ash::network_connect::ShowMobileSetup(service_path); |
1114 } | 1114 } |
1115 | 1115 |
1116 void InternetOptionsHandler::SetApnCallback(const base::ListValue* args) { | 1116 void InternetOptionsHandler::SetApnCallback(const base::ListValue* args) { |
1117 std::string service_path; | 1117 std::string service_path; |
1118 if (!args->GetString(0, &service_path)) { | 1118 if (!args->GetString(0, &service_path)) { |
1119 NOTREACHED(); | 1119 NOTREACHED(); |
1120 return; | 1120 return; |
1121 } | 1121 } |
1122 NetworkHandler::Get()->network_configuration_handler()->GetProperties( | 1122 NetworkHandler::Get()->network_configuration_handler()->GetProperties( |
1123 service_path, | 1123 service_path, |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 const std::string& service_path, | 1465 const std::string& service_path, |
1466 const base::DictionaryValue& shill_properties) { | 1466 const base::DictionaryValue& shill_properties) { |
1467 const NetworkState* network = GetNetworkState(service_path); | 1467 const NetworkState* network = GetNetworkState(service_path); |
1468 if (!network) { | 1468 if (!network) { |
1469 LOG(ERROR) << "Network properties not found: " << service_path; | 1469 LOG(ERROR) << "Network properties not found: " << service_path; |
1470 return; | 1470 return; |
1471 } | 1471 } |
1472 | 1472 |
1473 onc::ONCSource onc_source = onc::ONC_SOURCE_NONE; | 1473 onc::ONCSource onc_source = onc::ONC_SOURCE_NONE; |
1474 const base::DictionaryValue* onc = | 1474 const base::DictionaryValue* onc = |
1475 network_connect::FindPolicyForActiveUser(network, &onc_source); | 1475 onc::FindPolicyForActiveUser(network->guid(), &onc_source); |
1476 const NetworkPropertyUIData property_ui_data(onc_source); | 1476 const NetworkPropertyUIData property_ui_data(onc_source); |
1477 | 1477 |
1478 base::DictionaryValue dictionary; | 1478 base::DictionaryValue dictionary; |
1479 | 1479 |
1480 // Device hardware address | 1480 // Device hardware address |
1481 const DeviceState* device = NetworkHandler::Get()->network_state_handler()-> | 1481 const DeviceState* device = NetworkHandler::Get()->network_state_handler()-> |
1482 GetDeviceState(network->device_path()); | 1482 GetDeviceState(network->device_path()); |
1483 if (device) | 1483 if (device) |
1484 dictionary.SetString(kTagHardwareAddress, device->mac_address()); | 1484 dictionary.SetString(kTagHardwareAddress, device->mac_address()); |
1485 | 1485 |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2011 cellular && cellular->support_network_scan()); | 2011 cellular && cellular->support_network_scan()); |
2012 | 2012 |
2013 dictionary->SetBoolean(kTagWimaxAvailable, | 2013 dictionary->SetBoolean(kTagWimaxAvailable, |
2014 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); | 2014 handler->IsTechnologyAvailable(flimflam::kTypeWimax)); |
2015 dictionary->SetBoolean(kTagWimaxEnabled, | 2015 dictionary->SetBoolean(kTagWimaxEnabled, |
2016 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); | 2016 handler->IsTechnologyEnabled(flimflam::kTypeWimax)); |
2017 } | 2017 } |
2018 | 2018 |
2019 } // namespace options | 2019 } // namespace options |
2020 } // namespace chromeos | 2020 } // namespace chromeos |
OLD | NEW |