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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/internet_options_handler.cc

Issue 8764008: Remove import ONC option from internet settings (to be moved to net-internals). (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: remove localized strings Created 9 years 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
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/internet_options_handler.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 IDS_STATUSBAR_NETWORK_DEVICE_ENABLE, 510 IDS_STATUSBAR_NETWORK_DEVICE_ENABLE,
511 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_CELLULAR))); 511 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_CELLULAR)));
512 localized_strings->SetString("disableCellular", 512 localized_strings->SetString("disableCellular",
513 l10n_util::GetStringFUTF16( 513 l10n_util::GetStringFUTF16(
514 IDS_STATUSBAR_NETWORK_DEVICE_DISABLE, 514 IDS_STATUSBAR_NETWORK_DEVICE_DISABLE,
515 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_CELLULAR))); 515 l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_CELLULAR)));
516 localized_strings->SetString("useSharedProxies", 516 localized_strings->SetString("useSharedProxies",
517 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_USE_SHARED_PROXIES)); 517 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_USE_SHARED_PROXIES));
518 localized_strings->SetString("enableDataRoaming", 518 localized_strings->SetString("enableDataRoaming",
519 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_ENABLE_DATA_ROAMING)); 519 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_ENABLE_DATA_ROAMING));
520 localized_strings->SetString("importNetworkSettings",
521 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_IMPORT_NETWORK_SETTINGS));
522 localized_strings->SetString("invalidNetworkSettings",
523 l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_INVALID_NETWORK_SETTINGS));
524 localized_strings->SetString("generalNetworkingTitle", 520 localized_strings->SetString("generalNetworkingTitle",
525 l10n_util::GetStringUTF16( 521 l10n_util::GetStringUTF16(
526 IDS_OPTIONS_SETTINGS_INTERNET_CONTROL_TITLE)); 522 IDS_OPTIONS_SETTINGS_INTERNET_CONTROL_TITLE));
527 localized_strings->SetString("detailsInternetDismiss", 523 localized_strings->SetString("detailsInternetDismiss",
528 l10n_util::GetStringUTF16(IDS_CLOSE)); 524 l10n_util::GetStringUTF16(IDS_CLOSE));
529 localized_strings->SetString("ownerOnly", l10n_util::GetStringUTF16( 525 localized_strings->SetString("ownerOnly", l10n_util::GetStringUTF16(
530 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY)); 526 IDS_OPTIONS_ACCOUNTS_OWNER_ONLY));
531 std::string owner; 527 std::string owner;
532 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner); 528 chromeos::CrosSettings::Get()->GetString(chromeos::kDeviceOwner, &owner);
533 localized_strings->SetString("ownerUserId", UTF8ToUTF16(owner)); 529 localized_strings->SetString("ownerUserId", UTF8ToUTF16(owner));
(...skipping 28 matching lines...) Expand all
562 base::Unretained(this))); 558 base::Unretained(this)));
563 web_ui_->RegisterMessageCallback("disableWifi", 559 web_ui_->RegisterMessageCallback("disableWifi",
564 base::Bind(&InternetOptionsHandler::DisableWifiCallback, 560 base::Bind(&InternetOptionsHandler::DisableWifiCallback,
565 base::Unretained(this))); 561 base::Unretained(this)));
566 web_ui_->RegisterMessageCallback("enableCellular", 562 web_ui_->RegisterMessageCallback("enableCellular",
567 base::Bind(&InternetOptionsHandler::EnableCellularCallback, 563 base::Bind(&InternetOptionsHandler::EnableCellularCallback,
568 base::Unretained(this))); 564 base::Unretained(this)));
569 web_ui_->RegisterMessageCallback("disableCellular", 565 web_ui_->RegisterMessageCallback("disableCellular",
570 base::Bind(&InternetOptionsHandler::DisableCellularCallback, 566 base::Bind(&InternetOptionsHandler::DisableCellularCallback,
571 base::Unretained(this))); 567 base::Unretained(this)));
572 web_ui_->RegisterMessageCallback("importNetworkSettings",
573 base::Bind(&InternetOptionsHandler::ImportNetworkSettingsCallback,
574 base::Unretained(this)));
575 web_ui_->RegisterMessageCallback("buyDataPlan", 568 web_ui_->RegisterMessageCallback("buyDataPlan",
576 base::Bind(&InternetOptionsHandler::BuyDataPlanCallback, 569 base::Bind(&InternetOptionsHandler::BuyDataPlanCallback,
577 base::Unretained(this))); 570 base::Unretained(this)));
578 web_ui_->RegisterMessageCallback("showMorePlanInfo", 571 web_ui_->RegisterMessageCallback("showMorePlanInfo",
579 base::Bind(&InternetOptionsHandler::BuyDataPlanCallback, 572 base::Bind(&InternetOptionsHandler::BuyDataPlanCallback,
580 base::Unretained(this))); 573 base::Unretained(this)));
581 web_ui_->RegisterMessageCallback("setApn", 574 web_ui_->RegisterMessageCallback("setApn",
582 base::Bind(&InternetOptionsHandler::SetApnCallback, 575 base::Bind(&InternetOptionsHandler::SetApnCallback,
583 base::Unretained(this))); 576 base::Unretained(this)));
584 web_ui_->RegisterMessageCallback("setSimCardLock", 577 web_ui_->RegisterMessageCallback("setSimCardLock",
(...skipping 23 matching lines...) Expand all
608 } else { 601 } else {
609 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(), 602 chromeos::SimDialogDelegate::ShowDialog(GetNativeWindow(),
610 chromeos::SimDialogDelegate::SIM_DIALOG_UNLOCK); 603 chromeos::SimDialogDelegate::SIM_DIALOG_UNLOCK);
611 } 604 }
612 } 605 }
613 606
614 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) { 607 void InternetOptionsHandler::DisableCellularCallback(const ListValue* args) {
615 cros_->EnableCellularNetworkDevice(false); 608 cros_->EnableCellularNetworkDevice(false);
616 } 609 }
617 610
618 void InternetOptionsHandler::ImportNetworkSettingsCallback(
619 const ListValue* args) {
620 std::string onc_blob;
621 if (args->GetSize() != 1 ||
622 !args->GetString(0, &onc_blob)) {
623 NOTREACHED();
624 return;
625 }
626
627 if (!cros_->LoadOncNetworks(onc_blob))
628 web_ui_->CallJavascriptFunction(
629 "options.InternetOptions.invalidNetworkSettings");
630 }
631
632 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) { 611 void InternetOptionsHandler::BuyDataPlanCallback(const ListValue* args) {
633 if (!web_ui_) 612 if (!web_ui_)
634 return; 613 return;
635 Browser* browser = BrowserList::FindBrowserWithFeature( 614 Browser* browser = BrowserList::FindBrowserWithFeature(
636 Profile::FromWebUI(web_ui_), Browser::FEATURE_TABSTRIP); 615 Profile::FromWebUI(web_ui_), Browser::FEATURE_TABSTRIP);
637 if (browser) 616 if (browser)
638 browser->OpenMobilePlanTabAndActivate(); 617 browser->OpenMobilePlanTabAndActivate();
639 } 618 }
640 619
641 void InternetOptionsHandler::SetApnCallback(const ListValue* args) { 620 void InternetOptionsHandler::SetApnCallback(const ListValue* args) {
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after
1328 dictionary->Set("wirelessList", GetWirelessList()); 1307 dictionary->Set("wirelessList", GetWirelessList());
1329 dictionary->Set("vpnList", GetVPNList()); 1308 dictionary->Set("vpnList", GetVPNList());
1330 dictionary->Set("rememberedList", GetRememberedList()); 1309 dictionary->Set("rememberedList", GetRememberedList());
1331 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available()); 1310 dictionary->SetBoolean("wifiAvailable", cros_->wifi_available());
1332 dictionary->SetBoolean("wifiBusy", cros_->wifi_busy()); 1311 dictionary->SetBoolean("wifiBusy", cros_->wifi_busy());
1333 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled()); 1312 dictionary->SetBoolean("wifiEnabled", cros_->wifi_enabled());
1334 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available()); 1313 dictionary->SetBoolean("cellularAvailable", cros_->cellular_available());
1335 dictionary->SetBoolean("cellularBusy", cros_->cellular_busy()); 1314 dictionary->SetBoolean("cellularBusy", cros_->cellular_busy());
1336 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled()); 1315 dictionary->SetBoolean("cellularEnabled", cros_->cellular_enabled());
1337 } 1316 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/internet_options_handler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698