OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/ui/webui/chromeos/network_config_message_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/network_config_message_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chromeos/network/favorite_state.h" | |
14 #include "chromeos/network/managed_network_configuration_handler.h" | 13 #include "chromeos/network/managed_network_configuration_handler.h" |
15 #include "chromeos/network/network_state.h" | 14 #include "chromeos/network/network_state.h" |
16 #include "chromeos/network/network_state_handler.h" | 15 #include "chromeos/network/network_state_handler.h" |
17 #include "chromeos/network/network_util.h" | 16 #include "chromeos/network/network_util.h" |
18 #include "chromeos/network/onc/onc_signature.h" | 17 #include "chromeos/network/onc/onc_signature.h" |
19 #include "chromeos/network/onc/onc_utils.h" | 18 #include "chromeos/network/onc/onc_utils.h" |
20 #include "chromeos/network/shill_property_util.h" | 19 #include "chromeos/network/shill_property_util.h" |
21 #include "components/onc/onc_constants.h" | 20 #include "components/onc/onc_constants.h" |
22 #include "content/public/browser/web_ui.h" | 21 #include "content/public/browser/web_ui.h" |
23 #include "third_party/cros_system_api/dbus/service_constants.h" | 22 #include "third_party/cros_system_api/dbus/service_constants.h" |
24 | 23 |
25 namespace chromeos { | 24 namespace chromeos { |
26 | 25 |
27 namespace { | 26 namespace { |
28 | 27 |
29 bool GetServicePathFromGuid(const std::string& guid, | 28 bool GetServicePathFromGuid(const std::string& guid, |
30 std::string* service_path) { | 29 std::string* service_path) { |
31 const FavoriteState* network = | 30 const NetworkState* network = |
32 NetworkHandler::Get()->network_state_handler()->GetFavoriteStateFromGuid( | 31 NetworkHandler::Get()->network_state_handler()->GetNetworkStateFromGuid( |
33 guid); | 32 guid); |
34 if (!network) | 33 if (!network) |
35 return false; | 34 return false; |
36 *service_path = network->path(); | 35 *service_path = network->path(); |
37 return true; | 36 return true; |
38 } | 37 } |
39 | 38 |
40 } // namespace | 39 } // namespace |
41 | 40 |
42 NetworkConfigMessageHandler::NetworkConfigMessageHandler() | 41 NetworkConfigMessageHandler::NetworkConfigMessageHandler() |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 scoped_ptr<base::DictionaryValue> error_data) const { | 135 scoped_ptr<base::DictionaryValue> error_data) const { |
137 LOG(ERROR) << "NetworkConfigMessageHandler Error: " << error_name; | 136 LOG(ERROR) << "NetworkConfigMessageHandler Error: " << error_name; |
138 base::ListValue arg_list; | 137 base::ListValue arg_list; |
139 arg_list.AppendInteger(callback_id); | 138 arg_list.AppendInteger(callback_id); |
140 arg_list.AppendString(error_name); | 139 arg_list.AppendString(error_name); |
141 web_ui()->CallJavascriptFunction( | 140 web_ui()->CallJavascriptFunction( |
142 "networkConfig.chromeCallbackError", arg_list); | 141 "networkConfig.chromeCallbackError", arg_list); |
143 } | 142 } |
144 | 143 |
145 } // namespace chromeos | 144 } // namespace chromeos |
OLD | NEW |