Chromium Code Reviews| 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 | 371 |
| 372 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); | 372 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 void TestingAutomationProvider::GetNetworkInfo(DictionaryValue* args, | 375 void TestingAutomationProvider::GetNetworkInfo(DictionaryValue* args, |
| 376 IPC::Message* reply_message) { | 376 IPC::Message* reply_message) { |
| 377 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 377 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
| 378 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); | 378 NetworkLibrary* network_library = CrosLibrary::Get()->GetNetworkLibrary(); |
| 379 | 379 |
| 380 return_value->SetBoolean("offline_mode", | 380 return_value->SetBoolean("offline_mode", |
| 381 net::NetworkChangeNotifier::IsOffline()); | 381 net::NetworkChangeNotifier::GetConnectionType() == |
| 382 net::NetworkChangeNotifier::CONNECTION_NONE); | |
|
wtc
2012/05/11 01:35:05
Nit: this line doesn't eed to be indented.
| |
| 382 | 383 |
| 383 // IP address. | 384 // IP address. |
| 384 return_value->SetString("ip_address", network_library->IPAddress()); | 385 return_value->SetString("ip_address", network_library->IPAddress()); |
| 385 | 386 |
| 386 // Currently connected networks. | 387 // Currently connected networks. |
| 387 if (network_library->ethernet_network()) | 388 if (network_library->ethernet_network()) |
| 388 return_value->SetString( | 389 return_value->SetString( |
| 389 "connected_ethernet", | 390 "connected_ethernet", |
| 390 network_library->ethernet_network()->service_path()); | 391 network_library->ethernet_network()->service_path()); |
| 391 if (network_library->wifi_network()) | 392 if (network_library->wifi_network()) |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1235 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1236 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1236 AddObserver(power_manager_observer_); | 1237 AddObserver(power_manager_observer_); |
| 1237 } | 1238 } |
| 1238 | 1239 |
| 1239 void TestingAutomationProvider::RemoveChromeosObservers() { | 1240 void TestingAutomationProvider::RemoveChromeosObservers() { |
| 1240 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1241 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
| 1241 RemoveObserver(power_manager_observer_); | 1242 RemoveObserver(power_manager_observer_); |
| 1242 delete power_manager_observer_; | 1243 delete power_manager_observer_; |
| 1243 power_manager_observer_ = NULL; | 1244 power_manager_observer_ = NULL; |
| 1244 } | 1245 } |
| OLD | NEW |