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

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

Issue 1057613006: Use networkingPrivate.getDeviceState in Internet Settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase + WS Created 5 years, 8 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
« no previous file with comments | « chrome/browser/resources/options/chromeos/network_list.js ('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) 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 const char kSetNetworkGuidMessage[] = "setNetworkGuid"; 99 const char kSetNetworkGuidMessage[] = "setNetworkGuid";
100 100
101 // TODO(stevenjb): Deprecate these and integrate with settings Web UI. 101 // TODO(stevenjb): Deprecate these and integrate with settings Web UI.
102 const char kAddVPNConnectionMessage[] = "addVPNConnection"; 102 const char kAddVPNConnectionMessage[] = "addVPNConnection";
103 const char kAddNonVPNConnectionMessage[] = "addNonVPNConnection"; 103 const char kAddNonVPNConnectionMessage[] = "addNonVPNConnection";
104 const char kConfigureNetworkMessage[] = "configureNetwork"; 104 const char kConfigureNetworkMessage[] = "configureNetwork";
105 105
106 const char kLoadVPNProviders[] = "loadVPNProviders"; 106 const char kLoadVPNProviders[] = "loadVPNProviders";
107 107
108 // These are strings used to communicate with JavaScript. 108 // These are strings used to communicate with JavaScript.
109 const char kTagCellularAvailable[] = "cellularAvailable";
110 const char kTagCellularEnabled[] = "cellularEnabled";
111 const char kTagCellularSimAbsent[] = "cellularSimAbsent"; 109 const char kTagCellularSimAbsent[] = "cellularSimAbsent";
112 const char kTagCellularSimLockType[] = "cellularSimLockType"; 110 const char kTagCellularSimLockType[] = "cellularSimLockType";
113 const char kTagCellularSupportsScan[] = "cellularSupportsScan"; 111 const char kTagCellularSupportsScan[] = "cellularSupportsScan";
114 const char kTagRememberedList[] = "rememberedList"; 112 const char kTagRememberedList[] = "rememberedList";
115 const char kTagSimOpChangePin[] = "changePin"; 113 const char kTagSimOpChangePin[] = "changePin";
116 const char kTagSimOpConfigure[] = "configure"; 114 const char kTagSimOpConfigure[] = "configure";
117 const char kTagSimOpSetLocked[] = "setLocked"; 115 const char kTagSimOpSetLocked[] = "setLocked";
118 const char kTagSimOpSetUnlocked[] = "setUnlocked"; 116 const char kTagSimOpSetUnlocked[] = "setUnlocked";
119 const char kTagSimOpUnlock[] = "unlock"; 117 const char kTagSimOpUnlock[] = "unlock";
120 const char kTagVPNProviderName[] = "name"; 118 const char kTagVPNProviderName[] = "name";
121 const char kTagVPNProviderExtensionID[] = "extensionID"; 119 const char kTagVPNProviderExtensionID[] = "extensionID";
122 const char kTagVpnList[] = "vpnList"; 120 const char kTagVpnList[] = "vpnList";
123 const char kTagWifiAvailable[] = "wifiAvailable";
124 const char kTagWifiEnabled[] = "wifiEnabled";
125 const char kTagWimaxAvailable[] = "wimaxAvailable";
126 const char kTagWimaxEnabled[] = "wimaxEnabled";
127 const char kTagWiredList[] = "wiredList"; 121 const char kTagWiredList[] = "wiredList";
128 const char kTagWirelessList[] = "wirelessList"; 122 const char kTagWirelessList[] = "wirelessList";
129 123
130 void ShillError(const std::string& function, 124 void ShillError(const std::string& function,
131 const std::string& error_name, 125 const std::string& error_name,
132 scoped_ptr<base::DictionaryValue> error_data) { 126 scoped_ptr<base::DictionaryValue> error_data) {
133 // UpdateConnectionData may send requests for stale services; ignore 127 // UpdateConnectionData may send requests for stale services; ignore
134 // these errors. 128 // these errors.
135 if (function == "UpdateConnectionData" && 129 if (function == "UpdateConnectionData" &&
136 error_name == network_handler::kDBusFailedError) 130 error_name == network_handler::kDBusFailedError)
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 } 583 }
590 584
591 void InternetOptionsHandler::FillNetworkInfo( 585 void InternetOptionsHandler::FillNetworkInfo(
592 base::DictionaryValue* dictionary) { 586 base::DictionaryValue* dictionary) {
593 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); 587 NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler();
594 dictionary->Set(kTagWiredList, GetWiredList()); 588 dictionary->Set(kTagWiredList, GetWiredList());
595 dictionary->Set(kTagWirelessList, GetWirelessList()); 589 dictionary->Set(kTagWirelessList, GetWirelessList());
596 dictionary->Set(kTagVpnList, GetVPNList()); 590 dictionary->Set(kTagVpnList, GetVPNList());
597 dictionary->Set(kTagRememberedList, GetRememberedList()); 591 dictionary->Set(kTagRememberedList, GetRememberedList());
598 592
599 dictionary->SetBoolean(
600 kTagWifiAvailable,
601 handler->IsTechnologyAvailable(NetworkTypePattern::WiFi()));
602 dictionary->SetBoolean(
603 kTagWifiEnabled,
604 handler->IsTechnologyEnabled(NetworkTypePattern::WiFi()));
605
606 const DeviceState* cellular = 593 const DeviceState* cellular =
607 handler->GetDeviceStateByType(NetworkTypePattern::Mobile()); 594 handler->GetDeviceStateByType(NetworkTypePattern::Mobile());
608 dictionary->SetBoolean(
609 kTagCellularAvailable,
610 handler->IsTechnologyAvailable(NetworkTypePattern::Mobile()));
611 dictionary->SetBoolean(
612 kTagCellularEnabled,
613 handler->IsTechnologyEnabled(NetworkTypePattern::Mobile()));
614 dictionary->SetBoolean(kTagCellularSupportsScan, 595 dictionary->SetBoolean(kTagCellularSupportsScan,
615 cellular && cellular->support_network_scan()); 596 cellular && cellular->support_network_scan());
616 dictionary->SetBoolean(kTagCellularSimAbsent, 597 dictionary->SetBoolean(kTagCellularSimAbsent,
617 cellular && cellular->IsSimAbsent()); 598 cellular && cellular->IsSimAbsent());
618 dictionary->SetString(kTagCellularSimLockType, 599 dictionary->SetString(kTagCellularSimLockType,
619 cellular ? cellular->sim_lock_type() : ""); 600 cellular ? cellular->sim_lock_type() : "");
620
621 dictionary->SetBoolean(
622 kTagWimaxAvailable,
623 handler->IsTechnologyAvailable(NetworkTypePattern::Wimax()));
624 dictionary->SetBoolean(
625 kTagWimaxEnabled,
626 handler->IsTechnologyEnabled(NetworkTypePattern::Wimax()));
627 } 601 }
628 602
629 } // namespace options 603 } // namespace options
630 } // namespace chromeos 604 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/resources/options/chromeos/network_list.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698