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/values.h" | 10 #include "base/values.h" |
11 #include "chrome/browser/chromeos/login/user.h" | 11 #include "chrome/browser/chromeos/login/user.h" |
| 12 #include "chrome/browser/chromeos/login/user_manager.h" |
12 #include "chrome/browser/chromeos/ui_proxy_config.h" | 13 #include "chrome/browser/chromeos/ui_proxy_config.h" |
13 #include "chrome/browser/prefs/proxy_config_dictionary.h" | 14 #include "chrome/browser/prefs/proxy_config_dictionary.h" |
| 15 #include "chromeos/network/managed_network_configuration_handler.h" |
14 #include "chromeos/network/network_configuration_handler.h" | 16 #include "chromeos/network/network_configuration_handler.h" |
15 #include "chromeos/network/network_handler.h" | 17 #include "chromeos/network/network_handler.h" |
16 #include "chromeos/network/network_profile.h" | 18 #include "chromeos/network/network_profile.h" |
17 #include "chromeos/network/network_profile_handler.h" | 19 #include "chromeos/network/network_profile_handler.h" |
18 #include "chromeos/network/network_ui_data.h" | 20 #include "chromeos/network/network_ui_data.h" |
19 #include "chromeos/network/onc/onc_normalizer.h" | 21 #include "chromeos/network/onc/onc_normalizer.h" |
20 #include "chromeos/network/onc/onc_signature.h" | 22 #include "chromeos/network/onc/onc_signature.h" |
21 #include "chromeos/network/onc/onc_translator.h" | 23 #include "chromeos/network/onc/onc_translator.h" |
22 #include "chromeos/network/onc/onc_utils.h" | 24 #include "chromeos/network/onc/onc_utils.h" |
23 #include "net/base/host_port_pair.h" | 25 #include "net/base/host_port_pair.h" |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 shill_dict->SetStringWithoutPathExpansion(flimflam::kProfileProperty, | 224 shill_dict->SetStringWithoutPathExpansion(flimflam::kProfileProperty, |
223 profile->path); | 225 profile->path); |
224 | 226 |
225 NetworkHandler::Get()->network_configuration_handler()->CreateConfiguration( | 227 NetworkHandler::Get()->network_configuration_handler()->CreateConfiguration( |
226 *shill_dict, | 228 *shill_dict, |
227 network_handler::StringResultCallback(), | 229 network_handler::StringResultCallback(), |
228 network_handler::ErrorCallback()); | 230 network_handler::ErrorCallback()); |
229 } | 231 } |
230 } | 232 } |
231 | 233 |
| 234 const base::DictionaryValue* FindPolicyForActiveUser( |
| 235 const std::string& guid, |
| 236 onc::ONCSource* onc_source) { |
| 237 const User* user = UserManager::Get()->GetActiveUser(); |
| 238 std::string username_hash = user ? user->username_hash() : std::string(); |
| 239 return NetworkHandler::Get()->managed_network_configuration_handler()-> |
| 240 FindPolicyByGUID(username_hash, guid, onc_source); |
| 241 } |
| 242 |
232 } // namespace onc | 243 } // namespace onc |
233 } // namespace chromeos | 244 } // namespace chromeos |
OLD | NEW |