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

Side by Side Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 8588006: Eliminate CrosLibrary::EnsureLoaded (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698