| 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/options2/chromeos/internet_options_handler2.h" | 5 #include "chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.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 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 585 | 585 |
| 586 browser->OpenURL(content::OpenURLParams( | 586 browser->OpenURL(content::OpenURLParams( |
| 587 cellular->GetAccountInfoUrl(), content::Referrer(), | 587 cellular->GetAccountInfoUrl(), content::Referrer(), |
| 588 NEW_FOREGROUND_TAB, | 588 NEW_FOREGROUND_TAB, |
| 589 content::PAGE_TRANSITION_LINK, false)); | 589 content::PAGE_TRANSITION_LINK, false)); |
| 590 } | 590 } |
| 591 | 591 |
| 592 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { | 592 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { |
| 593 if (!web_ui()) | 593 if (!web_ui()) |
| 594 return; | 594 return; |
| 595 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); | 595 |
| 596 std::string service_path; |
| 597 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) { |
| 598 NOTREACHED(); |
| 599 return; |
| 600 } |
| 601 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(service_path); |
| 596 } | 602 } |
| 597 | 603 |
| 598 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { | 604 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { |
| 599 std::string service_path; | 605 std::string service_path; |
| 600 std::string apn; | 606 std::string apn; |
| 601 std::string username; | 607 std::string username; |
| 602 std::string password; | 608 std::string password; |
| 603 if (args->GetSize() != 4 || | 609 if (args->GetSize() != 4 || |
| 604 !args->GetString(0, &service_path) || | 610 !args->GetString(0, &service_path) || |
| 605 !args->GetString(1, &apn) || | 611 !args->GetString(1, &apn) || |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1224 const std::string& command) { | 1230 const std::string& command) { |
| 1225 chromeos::CellularNetwork* cellular = NULL; | 1231 chromeos::CellularNetwork* cellular = NULL; |
| 1226 if (service_path == kOtherNetworksFakePath) { | 1232 if (service_path == kOtherNetworksFakePath) { |
| 1227 chromeos::ChooseMobileNetworkDialog::ShowDialog(GetNativeWindow()); | 1233 chromeos::ChooseMobileNetworkDialog::ShowDialog(GetNativeWindow()); |
| 1228 } else if ((cellular = cros_->FindCellularNetworkByPath(service_path))) { | 1234 } else if ((cellular = cros_->FindCellularNetworkByPath(service_path))) { |
| 1229 if (command == "connect") { | 1235 if (command == "connect") { |
| 1230 cros_->ConnectToCellularNetwork(cellular); | 1236 cros_->ConnectToCellularNetwork(cellular); |
| 1231 } else if (command == "disconnect") { | 1237 } else if (command == "disconnect") { |
| 1232 cros_->DisconnectFromNetwork(cellular); | 1238 cros_->DisconnectFromNetwork(cellular); |
| 1233 } else if (command == "activate") { | 1239 } else if (command == "activate") { |
| 1234 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); | 1240 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(service_path); |
| 1235 } else if (command == "options") { | 1241 } else if (command == "options") { |
| 1236 PopulateDictionaryDetails(cellular); | 1242 PopulateDictionaryDetails(cellular); |
| 1237 } | 1243 } |
| 1238 } | 1244 } |
| 1239 } | 1245 } |
| 1240 | 1246 |
| 1241 void InternetOptionsHandler::HandleVPNButtonClick( | 1247 void InternetOptionsHandler::HandleVPNButtonClick( |
| 1242 const std::string& service_path, | 1248 const std::string& service_path, |
| 1243 const std::string& command) { | 1249 const std::string& command) { |
| 1244 chromeos::VirtualNetwork* network = NULL; | 1250 chromeos::VirtualNetwork* network = NULL; |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 if (default_value) | 1472 if (default_value) |
| 1467 value_dict->Set("default", default_value->DeepCopy()); | 1473 value_dict->Set("default", default_value->DeepCopy()); |
| 1468 if (ui_data.managed()) | 1474 if (ui_data.managed()) |
| 1469 value_dict->SetString("controlledBy", "policy"); | 1475 value_dict->SetString("controlledBy", "policy"); |
| 1470 else if (ui_data.recommended()) | 1476 else if (ui_data.recommended()) |
| 1471 value_dict->SetString("controlledBy", "recommended"); | 1477 value_dict->SetString("controlledBy", "recommended"); |
| 1472 settings->Set(key, value_dict); | 1478 settings->Set(key, value_dict); |
| 1473 } | 1479 } |
| 1474 | 1480 |
| 1475 } // namespace options2 | 1481 } // namespace options2 |
| OLD | NEW |