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

Unified Diff: chrome/browser/ui/webui/chromeos/network_config_message_handler.cc

Issue 492383002: Use ONC for Cellular APN and SimLock in Settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc b/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
index bb1feff04e8e3a971f83c417bee7893ac4406d0a..7d88bcd4af62c47064fe6a45542f8009e0e5a100 100644
--- a/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/network_config_message_handler.cc
@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/values.h"
#include "chromeos/login/login_state.h"
+#include "chromeos/network/device_state.h"
#include "chromeos/network/managed_network_configuration_handler.h"
#include "chromeos/network/network_configuration_handler.h"
#include "chromeos/network/network_state.h"
@@ -173,12 +174,32 @@ void NetworkConfigMessageHandler::GetShillProperties(
}
NetworkHandler::Get()->network_configuration_handler()->GetProperties(
service_path,
- base::Bind(&NetworkConfigMessageHandler::GetPropertiesSuccess,
+ base::Bind(&NetworkConfigMessageHandler::GetShillPropertiesSuccess,
weak_ptr_factory_.GetWeakPtr(), callback_id),
base::Bind(&NetworkConfigMessageHandler::ErrorCallback,
weak_ptr_factory_.GetWeakPtr(), callback_id));
}
+void NetworkConfigMessageHandler::GetShillPropertiesSuccess(
+ int callback_id,
+ const std::string& service_path,
+ const base::DictionaryValue& dictionary) const {
+ scoped_ptr<base::DictionaryValue> dictionary_copy(dictionary.DeepCopy());
+
+ // Get the device properties for debugging.
+ std::string device;
+ dictionary_copy->GetStringWithoutPathExpansion(
+ shill::kDeviceProperty, &device);
+ const DeviceState* device_state =
+ NetworkHandler::Get()->network_state_handler()->GetDeviceState(device);
+ if (device_state) {
+ base::DictionaryValue* device_dictionary =
+ device_state->properties().DeepCopy();
+ dictionary_copy->Set(shill::kDeviceProperty, device_dictionary);
+ }
+ GetPropertiesSuccess(callback_id, service_path, *dictionary_copy);
+}
+
void NetworkConfigMessageHandler::InvokeCallback(
const base::ListValue& arg_list) const {
web_ui()->CallJavascriptFunction(

Powered by Google App Engine
This is Rietveld 408576698