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

Side by Side Diff: chromeos/network/device_state.cc

Issue 17091006: Add additional cellular-related properties to Network|DeviceState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address stevenjb comments Created 7 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
« no previous file with comments | « chromeos/network/device_state.h ('k') | chromeos/network/network_state.h » ('j') | 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 "chromeos/network/device_state.h" 5 #include "chromeos/network/device_state.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "third_party/cros_system_api/dbus/service_constants.h" 10 #include "third_party/cros_system_api/dbus/service_constants.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 return GetStringValue(key, value, &technology_family_); 61 return GetStringValue(key, value, &technology_family_);
62 } else if (key == flimflam::kSIMLockStatusProperty) { 62 } else if (key == flimflam::kSIMLockStatusProperty) {
63 const DictionaryValue* dict = NULL; 63 const DictionaryValue* dict = NULL;
64 if (!value.GetAsDictionary(&dict)) 64 if (!value.GetAsDictionary(&dict))
65 return false; 65 return false;
66 if (!dict->GetStringWithoutPathExpansion(flimflam::kSIMLockTypeProperty, 66 if (!dict->GetStringWithoutPathExpansion(flimflam::kSIMLockTypeProperty,
67 &sim_lock_type_)) 67 &sim_lock_type_))
68 return false; 68 return false;
69 // Ignore other SIMLockStatus properties. 69 // Ignore other SIMLockStatus properties.
70 return true; 70 return true;
71 } else if (key == flimflam::kMeidProperty) {
72 return GetStringValue(key, value, &meid_);
73 } else if (key == flimflam::kImeiProperty) {
74 return GetStringValue(key, value, &imei_);
75 } else if (key == flimflam::kIccidProperty) {
76 return GetStringValue(key, value, &iccid_);
77 } else if (key == flimflam::kMdnProperty) {
78 return GetStringValue(key, value, &mdn_);
71 } else if (key == shill::kSIMPresentProperty) { 79 } else if (key == shill::kSIMPresentProperty) {
72 return GetBooleanValue(key, value, &sim_present_); 80 return GetBooleanValue(key, value, &sim_present_);
73 } 81 }
74 return false; 82 return false;
75 } 83 }
76 84
77 bool DeviceState::IsSimAbsent() const { 85 bool DeviceState::IsSimAbsent() const {
78 return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_; 86 return technology_family_ == flimflam::kTechnologyFamilyGsm && !sim_present_;
79 } 87 }
80 88
81 } // namespace chromeos 89 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/device_state.h ('k') | chromeos/network/network_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698