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

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

Issue 12676017: Adding policy support to the new network configuration stack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed clang errors. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chromeos/network/network_state.h ('k') | chromeos/network/network_ui_data.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/network_state.h" 5 #include "chromeos/network/network_state.h"
6 6
7 #include "base/stringprintf.h" 7 #include "base/stringprintf.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "third_party/cros_system_api/dbus/service_constants.h" 9 #include "third_party/cros_system_api/dbus/service_constants.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } else if (key == flimflam::kFavoriteProperty) { 68 } else if (key == flimflam::kFavoriteProperty) {
69 return GetBooleanValue(key, value, &favorite_); 69 return GetBooleanValue(key, value, &favorite_);
70 } else if (key == flimflam::kPriorityProperty) { 70 } else if (key == flimflam::kPriorityProperty) {
71 return GetIntegerValue(key, value, &priority_); 71 return GetIntegerValue(key, value, &priority_);
72 } else if (key == flimflam::kNetworkTechnologyProperty) { 72 } else if (key == flimflam::kNetworkTechnologyProperty) {
73 return GetStringValue(key, value, &technology_); 73 return GetStringValue(key, value, &technology_);
74 } else if (key == flimflam::kDeviceProperty) { 74 } else if (key == flimflam::kDeviceProperty) {
75 return GetStringValue(key, value, &device_path_); 75 return GetStringValue(key, value, &device_path_);
76 } else if (key == flimflam::kGuidProperty) { 76 } else if (key == flimflam::kGuidProperty) {
77 return GetStringValue(key, value, &guid_); 77 return GetStringValue(key, value, &guid_);
78 } else if (key == flimflam::kProfileProperty) {
79 return GetStringValue(key, value, &profile_path_);
78 } else if (key == shill::kActivateOverNonCellularNetworkProperty) { 80 } else if (key == shill::kActivateOverNonCellularNetworkProperty) {
79 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_); 81 return GetBooleanValue(key, value, &activate_over_non_cellular_networks_);
80 } else if (key == shill::kOutOfCreditsProperty) { 82 } else if (key == shill::kOutOfCreditsProperty) {
81 return GetBooleanValue(key, value, &cellular_out_of_credits_); 83 return GetBooleanValue(key, value, &cellular_out_of_credits_);
82 } 84 }
83 return false; 85 return false;
84 } 86 }
85 87
86 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const { 88 void NetworkState::GetProperties(base::DictionaryValue* dictionary) const {
87 // Keep care that these properties are the same as in |PropertyChanged|. 89 // Keep care that these properties are the same as in |PropertyChanged|.
(...skipping 26 matching lines...) Expand all
114 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty, 116 dictionary->SetBooleanWithoutPathExpansion(flimflam::kFavoriteProperty,
115 favorite()); 117 favorite());
116 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty, 118 dictionary->SetIntegerWithoutPathExpansion(flimflam::kPriorityProperty,
117 priority()); 119 priority());
118 dictionary->SetStringWithoutPathExpansion( 120 dictionary->SetStringWithoutPathExpansion(
119 flimflam::kNetworkTechnologyProperty, 121 flimflam::kNetworkTechnologyProperty,
120 technology()); 122 technology());
121 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty, 123 dictionary->SetStringWithoutPathExpansion(flimflam::kDeviceProperty,
122 device_path()); 124 device_path());
123 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid()); 125 dictionary->SetStringWithoutPathExpansion(flimflam::kGuidProperty, guid());
126 dictionary->SetStringWithoutPathExpansion(flimflam::kProfileProperty,
127 profile_path());
124 dictionary->SetBooleanWithoutPathExpansion( 128 dictionary->SetBooleanWithoutPathExpansion(
125 shill::kActivateOverNonCellularNetworkProperty, 129 shill::kActivateOverNonCellularNetworkProperty,
126 activate_over_non_cellular_networks()); 130 activate_over_non_cellular_networks());
127 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty, 131 dictionary->SetBooleanWithoutPathExpansion(shill::kOutOfCreditsProperty,
128 cellular_out_of_credits()); 132 cellular_out_of_credits());
129 } 133 }
130 134
131 bool NetworkState::IsConnectedState() const { 135 bool NetworkState::IsConnectedState() const {
132 return StateIsConnected(connection_state_); 136 return StateIsConnected(connection_state_);
133 } 137 }
(...skipping 15 matching lines...) Expand all
149 connection_state == flimflam::kStateConfiguration || 153 connection_state == flimflam::kStateConfiguration ||
150 connection_state == flimflam::kStateCarrier); 154 connection_state == flimflam::kStateCarrier);
151 } 155 }
152 156
153 // static 157 // static
154 std::string NetworkState::IPConfigProperty(const char* key) { 158 std::string NetworkState::IPConfigProperty(const char* key) {
155 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key); 159 return base::StringPrintf("%s.%s", shill::kIPConfigProperty, key);
156 } 160 }
157 161
158 } // namespace chromeos 162 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/network_state.h ('k') | chromeos/network/network_ui_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698