Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(433)

Side by Side Diff: chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.cc

Issue 10456045: Refactored mobile activation engine outside of WebUI handler in order to expose its state to other … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 560 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 571
572 browser->OpenURL(content::OpenURLParams( 572 browser->OpenURL(content::OpenURLParams(
573 cellular->GetAccountInfoUrl(), content::Referrer(), 573 cellular->GetAccountInfoUrl(), content::Referrer(),
574 NEW_FOREGROUND_TAB, 574 NEW_FOREGROUND_TAB,
575 content::PAGE_TRANSITION_LINK, false)); 575 content::PAGE_TRANSITION_LINK, false));
576 } 576 }
577 577
578 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { 578 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) {
579 if (!web_ui()) 579 if (!web_ui())
580 return; 580 return;
581 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); 581
582 std::string service_path;
583 if (args->GetSize() != 1 || !args->GetString(0, &service_path)) {
584 NOTREACHED();
585 return;
586 }
587 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(service_path);
582 } 588 }
583 589
584 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { 590 void InternetOptionsHandler::SetApnCallback(const ListValue* args) {
585 std::string service_path; 591 std::string service_path;
586 std::string apn; 592 std::string apn;
587 std::string username; 593 std::string username;
588 std::string password; 594 std::string password;
589 if (args->GetSize() != 4 || 595 if (args->GetSize() != 4 ||
590 !args->GetString(0, &service_path) || 596 !args->GetString(0, &service_path) ||
591 !args->GetString(1, &apn) || 597 !args->GetString(1, &apn) ||
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 const std::string& command) { 1210 const std::string& command) {
1205 chromeos::CellularNetwork* cellular = NULL; 1211 chromeos::CellularNetwork* cellular = NULL;
1206 if (service_path == kOtherNetworksFakePath) { 1212 if (service_path == kOtherNetworksFakePath) {
1207 chromeos::ChooseMobileNetworkDialog::ShowDialog(GetNativeWindow()); 1213 chromeos::ChooseMobileNetworkDialog::ShowDialog(GetNativeWindow());
1208 } else if ((cellular = cros_->FindCellularNetworkByPath(service_path))) { 1214 } else if ((cellular = cros_->FindCellularNetworkByPath(service_path))) {
1209 if (command == "connect") { 1215 if (command == "connect") {
1210 cros_->ConnectToCellularNetwork(cellular); 1216 cros_->ConnectToCellularNetwork(cellular);
1211 } else if (command == "disconnect") { 1217 } else if (command == "disconnect") {
1212 cros_->DisconnectFromNetwork(cellular); 1218 cros_->DisconnectFromNetwork(cellular);
1213 } else if (command == "activate") { 1219 } else if (command == "activate") {
1214 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); 1220 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(service_path);
1215 } else if (command == "options") { 1221 } else if (command == "options") {
1216 PopulateDictionaryDetails(cellular); 1222 PopulateDictionaryDetails(cellular);
1217 } 1223 }
1218 } 1224 }
1219 } 1225 }
1220 1226
1221 void InternetOptionsHandler::HandleVPNButtonClick( 1227 void InternetOptionsHandler::HandleVPNButtonClick(
1222 const std::string& service_path, 1228 const std::string& service_path,
1223 const std::string& command) { 1229 const std::string& command) {
1224 chromeos::VirtualNetwork* network = NULL; 1230 chromeos::VirtualNetwork* network = NULL;
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1441 if (default_value) 1447 if (default_value)
1442 value_dict->Set("default", default_value->DeepCopy()); 1448 value_dict->Set("default", default_value->DeepCopy());
1443 if (ui_data.managed()) 1449 if (ui_data.managed())
1444 value_dict->SetString("controlledBy", "policy"); 1450 value_dict->SetString("controlledBy", "policy");
1445 else if (ui_data.recommended()) 1451 else if (ui_data.recommended())
1446 value_dict->SetString("controlledBy", "recommended"); 1452 value_dict->SetString("controlledBy", "recommended");
1447 settings->Set(key, value_dict); 1453 settings->Set(key, value_dict);
1448 } 1454 }
1449 1455
1450 } // namespace options2 1456 } // namespace options2
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698