OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_network_configuration_handler.h" | 5 #include "chromeos/network/managed_network_configuration_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "chromeos/network/onc/onc_translator.h" | 36 #include "chromeos/network/onc/onc_translator.h" |
37 #include "chromeos/network/onc/onc_utils.h" | 37 #include "chromeos/network/onc/onc_utils.h" |
38 #include "chromeos/network/onc/onc_validator.h" | 38 #include "chromeos/network/onc/onc_validator.h" |
39 #include "dbus/object_path.h" | 39 #include "dbus/object_path.h" |
40 #include "third_party/cros_system_api/dbus/service_constants.h" | 40 #include "third_party/cros_system_api/dbus/service_constants.h" |
41 | 41 |
42 namespace chromeos { | 42 namespace chromeos { |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 const char kLogModule[] = "ManagedNetworkConfigurationHandler"; | |
47 | |
48 // These are error strings used for error callbacks. None of these error | 46 // These are error strings used for error callbacks. None of these error |
49 // messages are user-facing: they should only appear in logs. | 47 // messages are user-facing: they should only appear in logs. |
50 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; | 48 const char kInvalidUserSettingsMessage[] = "User settings are invalid."; |
51 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; | 49 const char kInvalidUserSettings[] = "Error.InvalidUserSettings"; |
52 const char kNetworkAlreadyConfiguredMessage[] = | 50 const char kNetworkAlreadyConfiguredMessage[] = |
53 "Network is already configured."; | 51 "Network is already configured."; |
54 const char kNetworkAlreadyConfigured[] = "Error.NetworkAlreadyConfigured"; | 52 const char kNetworkAlreadyConfigured[] = "Error.NetworkAlreadyConfigured"; |
55 const char kPoliciesNotInitializedMessage[] = "Policies not initialized."; | 53 const char kPoliciesNotInitializedMessage[] = "Policies not initialized."; |
56 const char kPoliciesNotInitialized[] = "Error.PoliciesNotInitialized"; | 54 const char kPoliciesNotInitialized[] = "Error.PoliciesNotInitialized"; |
57 const char kProfileNotInitializedMessage[] = "Profile not initialized."; | 55 const char kProfileNotInitializedMessage[] = "Profile not initialized."; |
(...skipping 13 matching lines...) Expand all Loading... |
71 std::string ToDebugString(onc::ONCSource source, | 69 std::string ToDebugString(onc::ONCSource source, |
72 const std::string& userhash) { | 70 const std::string& userhash) { |
73 return source == onc::ONC_SOURCE_USER_POLICY ? | 71 return source == onc::ONC_SOURCE_USER_POLICY ? |
74 ("user policy of " + userhash) : "device policy"; | 72 ("user policy of " + userhash) : "device policy"; |
75 } | 73 } |
76 | 74 |
77 void RunErrorCallback(const std::string& service_path, | 75 void RunErrorCallback(const std::string& service_path, |
78 const std::string& error_name, | 76 const std::string& error_name, |
79 const std::string& error_message, | 77 const std::string& error_message, |
80 const network_handler::ErrorCallback& error_callback) { | 78 const network_handler::ErrorCallback& error_callback) { |
81 network_event_log::AddEntry(kLogModule, error_name, error_message); | 79 NET_LOG_ERROR(error_name, error_message); |
82 error_callback.Run( | 80 error_callback.Run( |
83 error_name, | 81 error_name, |
84 make_scoped_ptr( | 82 make_scoped_ptr( |
85 network_handler::CreateErrorData(service_path, | 83 network_handler::CreateErrorData(service_path, |
86 error_name, | 84 error_name, |
87 error_message))); | 85 error_message))); |
88 } | 86 } |
89 | 87 |
90 // Sets the UIData property in |shill_dictionary| to the serialization of | 88 // Sets the UIData property in |shill_dictionary| to the serialization of |
91 // |ui_data|. | 89 // |ui_data|. |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
931 | 929 |
932 ManagedNetworkConfigurationHandler::~ManagedNetworkConfigurationHandler() { | 930 ManagedNetworkConfigurationHandler::~ManagedNetworkConfigurationHandler() { |
933 profile_handler_->RemoveObserver(this); | 931 profile_handler_->RemoveObserver(this); |
934 for (UserToPoliciesMap::iterator it = policies_by_user_.begin(); | 932 for (UserToPoliciesMap::iterator it = policies_by_user_.begin(); |
935 it != policies_by_user_.end(); ++it) { | 933 it != policies_by_user_.end(); ++it) { |
936 STLDeleteValues(&it->second); | 934 STLDeleteValues(&it->second); |
937 } | 935 } |
938 } | 936 } |
939 | 937 |
940 } // namespace chromeos | 938 } // namespace chromeos |
OLD | NEW |