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/managed_state.h" | 5 #include "chromeos/network/managed_state.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chromeos/network/device_state.h" | 9 #include "chromeos/network/device_state.h" |
10 #include "chromeos/network/favorite_state.h" | 10 #include "chromeos/network/favorite_state.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 return NULL; | 59 return NULL; |
60 } | 60 } |
61 | 61 |
62 bool ManagedState::InitialPropertiesReceived( | 62 bool ManagedState::InitialPropertiesReceived( |
63 const base::DictionaryValue& properties) { | 63 const base::DictionaryValue& properties) { |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 bool ManagedState::ManagedStatePropertyChanged(const std::string& key, | 67 bool ManagedState::ManagedStatePropertyChanged(const std::string& key, |
68 const base::Value& value) { | 68 const base::Value& value) { |
69 if (key == flimflam::kNameProperty) { | 69 if (key == shill::kNameProperty) { |
70 return GetStringValue(key, value, &name_); | 70 return GetStringValue(key, value, &name_); |
71 } else if (key == flimflam::kTypeProperty) { | 71 } else if (key == shill::kTypeProperty) { |
72 return GetStringValue(key, value, &type_); | 72 return GetStringValue(key, value, &type_); |
73 } | 73 } |
74 return false; | 74 return false; |
75 } | 75 } |
76 | 76 |
77 bool ManagedState::GetBooleanValue(const std::string& key, | 77 bool ManagedState::GetBooleanValue(const std::string& key, |
78 const base::Value& value, | 78 const base::Value& value, |
79 bool* out_value) { | 79 bool* out_value) { |
80 bool new_value; | 80 bool new_value; |
81 if (!value.GetAsBoolean(&new_value)) { | 81 if (!value.GetAsBoolean(&new_value)) { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 return false; | 129 return false; |
130 } | 130 } |
131 new_value = static_cast<uint32>(double_value); | 131 new_value = static_cast<uint32>(double_value); |
132 if (*out_value == new_value) | 132 if (*out_value == new_value) |
133 return false; | 133 return false; |
134 *out_value = new_value; | 134 *out_value = new_value; |
135 return true; | 135 return true; |
136 } | 136 } |
137 | 137 |
138 } // namespace chromeos | 138 } // namespace chromeos |
OLD | NEW |