Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 43 | 43 |
| 44 using chromeos::CrosLibrary; | 44 using chromeos::CrosLibrary; |
| 45 using chromeos::NetworkLibrary; | 45 using chromeos::NetworkLibrary; |
| 46 using chromeos::UpdateLibrary; | 46 using chromeos::UpdateLibrary; |
| 47 using chromeos::UserManager; | 47 using chromeos::UserManager; |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| 51 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, | 51 bool EnsureCrosLibraryLoaded(AutomationProvider* provider, |
| 52 IPC::Message* reply_message) { | 52 IPC::Message* reply_message) { |
| 53 if (!CrosLibrary::Get()->EnsureLoaded()) { | 53 if (!CrosLibrary::Get()->libcros_loaded()) { |
| 54 AutomationJSONReply(provider, reply_message).SendError( | 54 AutomationJSONReply(provider, reply_message).SendError( |
| 55 "Could not load cros library."); | 55 "Could not load cros library."); |
| 56 return false; | 56 return false; |
| 57 } | 57 } |
| 58 return true; | 58 return true; |
|
satorux1
2011/11/16 23:51:34
Can we remove the function? This is a wrapper arou
stevenjb
2011/11/17 00:23:33
Yes, that looks safe to do.
Done.
| |
| 59 } | 59 } |
| 60 | 60 |
| 61 DictionaryValue* GetNetworkInfoDict(const chromeos::Network* network) { | 61 DictionaryValue* GetNetworkInfoDict(const chromeos::Network* network) { |
| 62 DictionaryValue* item = new DictionaryValue; | 62 DictionaryValue* item = new DictionaryValue; |
| 63 item->SetString("name", network->name()); | 63 item->SetString("name", network->name()); |
| 64 item->SetString("device_path", network->device_path()); | 64 item->SetString("device_path", network->device_path()); |
| 65 item->SetString("ip_address", network->ip_address()); | 65 item->SetString("ip_address", network->ip_address()); |
| 66 item->SetString("status", network->GetStateString()); | 66 item->SetString("status", network->GetStateString()); |
| 67 return item; | 67 return item; |
| 68 } | 68 } |
| (...skipping 1135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1204 views::Widget* window = browser::CreateViewsWindow( | 1204 views::Widget* window = browser::CreateViewsWindow( |
| 1205 browser->window()->GetNativeHandle(), take_photo_dialog); | 1205 browser->window()->GetNativeHandle(), take_photo_dialog); |
| 1206 window->SetAlwaysOnTop(true); | 1206 window->SetAlwaysOnTop(true); |
| 1207 window->Show(); | 1207 window->Show(); |
| 1208 } | 1208 } |
| 1209 | 1209 |
| 1210 void TestingAutomationProvider::PowerChanged( | 1210 void TestingAutomationProvider::PowerChanged( |
| 1211 const chromeos::PowerSupplyStatus& status) { | 1211 const chromeos::PowerSupplyStatus& status) { |
| 1212 power_status = status; | 1212 power_status = status; |
| 1213 } | 1213 } |
| OLD | NEW |