Chromium Code Reviews| 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 "chromeos/network/onc/onc_translation_tables.h" | 5 #include "chromeos/network/onc/onc_translation_tables.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "components/onc/onc_constants.h" | 10 #include "components/onc/onc_constants.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 | 313 |
| 314 const StringTranslationEntry kActivationStateTable[] = { | 314 const StringTranslationEntry kActivationStateTable[] = { |
| 315 { ::onc::cellular::kActivated, shill::kActivationStateActivated}, | 315 { ::onc::cellular::kActivated, shill::kActivationStateActivated}, |
| 316 { ::onc::cellular::kActivating, shill::kActivationStateActivating}, | 316 { ::onc::cellular::kActivating, shill::kActivationStateActivating}, |
| 317 { ::onc::cellular::kNotActivated, shill::kActivationStateNotActivated}, | 317 { ::onc::cellular::kNotActivated, shill::kActivationStateNotActivated}, |
| 318 { ::onc::cellular::kPartiallyActivated, | 318 { ::onc::cellular::kPartiallyActivated, |
| 319 shill::kActivationStatePartiallyActivated}, | 319 shill::kActivationStatePartiallyActivated}, |
| 320 {NULL}}; | 320 {NULL}}; |
| 321 | 321 |
| 322 const StringTranslationEntry kRoamingStateTable[] = { | 322 const StringTranslationEntry kRoamingStateTable[] = { |
| 323 { ::onc::cellular::kHome, shill::kRoamingStateHome}, | 323 {::onc::cellular::kRoamingHome, shill::kRoamingStateHome}, |
|
armansito
2015/02/25 19:44:46
nit: it looks like there is a space after the open
stevenjb
2015/02/25 20:09:50
Done (although clang complains about this; some da
| |
| 324 { ::onc::cellular::kRoaming, shill::kRoamingStateRoaming}, | 324 {::onc::cellular::kRoamingRoaming, shill::kRoamingStateRoaming}, |
| 325 {NULL}}; | 325 {NULL}}; |
| 326 | 326 |
| 327 // This must contain only Shill Device properties and no Service properties. | 327 // This must contain only Shill Device properties and no Service properties. |
| 328 // For Service properties see cellular_fields. | 328 // For Service properties see cellular_fields. |
| 329 const FieldTranslationEntry kCellularDeviceTable[] = { | 329 const FieldTranslationEntry kCellularDeviceTable[] = { |
| 330 // This field is converted during translation, see onc_translator_*. | 330 // This field is converted during translation, see onc_translator_*. |
| 331 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, | 331 // { ::onc::cellular::kAPNList, shill::kCellularApnListProperty}, |
| 332 { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty}, | 332 { ::onc::cellular::kAllowRoaming, shill::kCellularAllowRoamingProperty}, |
| 333 { ::onc::cellular::kCarrier, shill::kCarrierProperty}, | 333 { ::onc::cellular::kCarrier, shill::kCarrierProperty}, |
| 334 { ::onc::cellular::kESN, shill::kEsnProperty}, | 334 { ::onc::cellular::kESN, shill::kEsnProperty}, |
| 335 { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty}, | 335 { ::onc::cellular::kFamily, shill::kTechnologyFamilyProperty}, |
| 336 { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty}, | 336 { ::onc::cellular::kFirmwareRevision, shill::kFirmwareRevisionProperty}, |
| 337 // This field is converted during translation, see onc_translator_*. | 337 // This field is converted during translation, see onc_translator_*. |
| 338 // { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty}, | 338 // { ::onc::cellular::kFoundNetworks, shill::kFoundNetworksProperty}, |
| 339 { ::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty}, | 339 { ::onc::cellular::kHardwareRevision, shill::kHardwareRevisionProperty}, |
| 340 { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty}, | 340 { ::onc::cellular::kHomeProvider, shill::kHomeProviderProperty}, |
| 341 { ::onc::cellular::kICCID, shill::kIccidProperty}, | 341 { ::onc::cellular::kICCID, shill::kIccidProperty}, |
| 342 { ::onc::cellular::kIMEI, shill::kImeiProperty}, | 342 { ::onc::cellular::kIMEI, shill::kImeiProperty}, |
| 343 { ::onc::cellular::kIMSI, shill::kImsiProperty}, | 343 { ::onc::cellular::kIMSI, shill::kImsiProperty}, |
| 344 { ::onc::cellular::kManufacturer, shill::kManufacturerProperty}, | 344 { ::onc::cellular::kManufacturer, shill::kManufacturerProperty}, |
| 345 { ::onc::cellular::kMDN, shill::kMdnProperty}, | 345 { ::onc::cellular::kMDN, shill::kMdnProperty}, |
| 346 { ::onc::cellular::kMEID, shill::kMeidProperty}, | 346 { ::onc::cellular::kMEID, shill::kMeidProperty}, |
| 347 { ::onc::cellular::kMIN, shill::kMinProperty}, | 347 { ::onc::cellular::kMIN, shill::kMinProperty}, |
| 348 { ::onc::cellular::kModelID, shill::kModelIDProperty}, | 348 { ::onc::cellular::kModelID, shill::kModelIDProperty}, |
| 349 { ::onc::cellular::kPRLVersion, shill::kPRLVersionProperty}, | 349 { ::onc::cellular::kPRLVersion, shill::kPRLVersionProperty}, |
| 350 { ::onc::cellular::kProviderRequiresRoaming, | |
| 351 shill::kProviderRequiresRoamingProperty}, | |
| 352 // This field is converted during translation, see onc_translator_*. | 350 // This field is converted during translation, see onc_translator_*. |
| 353 // { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty}, | 351 // { ::onc::cellular::kSIMLockStatus, shill::kSIMLockStatusProperty}, |
| 354 { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty}, | 352 { ::onc::cellular::kSIMPresent, shill::kSIMPresentProperty}, |
| 355 { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty}, | 353 { ::onc::cellular::kSupportedCarriers, shill::kSupportedCarriersProperty}, |
| 356 { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty}, | 354 { ::onc::cellular::kSupportNetworkScan, shill::kSupportNetworkScanProperty}, |
| 357 {NULL}}; | 355 {NULL}}; |
| 358 | 356 |
| 359 const FieldTranslationEntry* GetFieldTranslationTable( | 357 const FieldTranslationEntry* GetFieldTranslationTable( |
| 360 const OncValueSignature& onc_signature) { | 358 const OncValueSignature& onc_signature) { |
| 361 for (const OncValueTranslationEntry* it = onc_value_translation_table; | 359 for (const OncValueTranslationEntry* it = onc_value_translation_table; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 416 continue; | 414 continue; |
| 417 *onc_value = table[i].onc_value; | 415 *onc_value = table[i].onc_value; |
| 418 return true; | 416 return true; |
| 419 } | 417 } |
| 420 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; | 418 LOG(ERROR) << "Value '" << shill_value << "' cannot be translated to ONC"; |
| 421 return false; | 419 return false; |
| 422 } | 420 } |
| 423 | 421 |
| 424 } // namespace onc | 422 } // namespace onc |
| 425 } // namespace chromeos | 423 } // namespace chromeos |
| OLD | NEW |