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 "chrome/browser/chromeos/net/onc_utils.h" | 5 #include "chrome/browser/chromeos/net/onc_utils.h" |
6 | 6 |
7 #include "base/bind_helpers.h" | 7 #include "base/bind_helpers.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 } | 258 } |
259 } | 259 } |
260 | 260 |
261 if (ethernet_not_found) | 261 if (ethernet_not_found) |
262 *error = "No Ethernet available to configure."; | 262 *error = "No Ethernet available to configure."; |
263 } | 263 } |
264 | 264 |
265 const base::DictionaryValue* FindPolicyForActiveUser( | 265 const base::DictionaryValue* FindPolicyForActiveUser( |
266 const std::string& guid, | 266 const std::string& guid, |
267 ::onc::ONCSource* onc_source) { | 267 ::onc::ONCSource* onc_source) { |
268 const User* user = UserManager::Get()->GetActiveUser(); | 268 const User* user = GetUserManager()->GetActiveUser(); |
269 std::string username_hash = user ? user->username_hash() : std::string(); | 269 std::string username_hash = user ? user->username_hash() : std::string(); |
270 return NetworkHandler::Get()->managed_network_configuration_handler()-> | 270 return NetworkHandler::Get()->managed_network_configuration_handler()-> |
271 FindPolicyByGUID(username_hash, guid, onc_source); | 271 FindPolicyByGUID(username_hash, guid, onc_source); |
272 } | 272 } |
273 | 273 |
274 const base::DictionaryValue* GetGlobalConfigFromPolicy(bool for_active_user) { | 274 const base::DictionaryValue* GetGlobalConfigFromPolicy(bool for_active_user) { |
275 std::string username_hash; | 275 std::string username_hash; |
276 if (for_active_user) { | 276 if (for_active_user) { |
277 const User* user = UserManager::Get()->GetActiveUser(); | 277 const User* user = GetUserManager()->GetActiveUser(); |
278 if (!user) { | 278 if (!user) { |
279 LOG(ERROR) << "No user logged in yet."; | 279 LOG(ERROR) << "No user logged in yet."; |
280 return NULL; | 280 return NULL; |
281 } | 281 } |
282 username_hash = user->username_hash(); | 282 username_hash = user->username_hash(); |
283 } | 283 } |
284 return NetworkHandler::Get()->managed_network_configuration_handler()-> | 284 return NetworkHandler::Get()->managed_network_configuration_handler()-> |
285 GetGlobalConfigFromPolicy(username_hash); | 285 GetGlobalConfigFromPolicy(username_hash); |
286 } | 286 } |
287 | 287 |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 const PrefService* local_state_prefs, | 447 const PrefService* local_state_prefs, |
448 const NetworkState& network) { | 448 const NetworkState& network) { |
449 ::onc::ONCSource ignored_onc_source; | 449 ::onc::ONCSource ignored_onc_source; |
450 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( | 450 const base::DictionaryValue* policy = onc::GetPolicyForNetwork( |
451 profile_prefs, local_state_prefs, network, &ignored_onc_source); | 451 profile_prefs, local_state_prefs, network, &ignored_onc_source); |
452 return policy != NULL; | 452 return policy != NULL; |
453 } | 453 } |
454 | 454 |
455 } // namespace onc | 455 } // namespace onc |
456 } // namespace chromeos | 456 } // namespace chromeos |
OLD | NEW |