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 "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "ash/system/tray/system_tray_delegate.h" | 9 #include "ash/system/tray/system_tray_delegate.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 248 } |
249 // Observer will delete itself. | 249 // Observer will delete itself. |
250 new WizardControllerObserver(wizard_controller, this, reply_message); | 250 new WizardControllerObserver(wizard_controller, this, reply_message); |
251 wizard_controller->GetNetworkScreen()->OnContinuePressed(); | 251 wizard_controller->GetNetworkScreen()->OnContinuePressed(); |
252 } | 252 } |
253 | 253 |
254 void TestingAutomationProvider::AcceptOOBEEula(DictionaryValue* args, | 254 void TestingAutomationProvider::AcceptOOBEEula(DictionaryValue* args, |
255 IPC::Message* reply_message) { | 255 IPC::Message* reply_message) { |
256 bool accepted; | 256 bool accepted; |
257 bool usage_stats_reporting; | 257 bool usage_stats_reporting; |
| 258 bool rlz_enabled; |
258 if (!args->GetBoolean("accepted", &accepted) || | 259 if (!args->GetBoolean("accepted", &accepted) || |
259 !args->GetBoolean("usage_stats_reporting", &usage_stats_reporting)) { | 260 !args->GetBoolean("usage_stats_reporting", &usage_stats_reporting) || |
| 261 !args->GetBoolean("rlz_enabled", &rlz_enabled)) { |
260 AutomationJSONReply(this, reply_message).SendError( | 262 AutomationJSONReply(this, reply_message).SendError( |
261 "Invalid or missing args."); | 263 "Invalid or missing args."); |
262 return; | 264 return; |
263 } | 265 } |
264 | 266 |
265 WizardController* wizard_controller = WizardController::default_controller(); | 267 WizardController* wizard_controller = WizardController::default_controller(); |
266 if (!wizard_controller || wizard_controller->current_screen()->GetName() != | 268 if (!wizard_controller || wizard_controller->current_screen()->GetName() != |
267 WizardController::kEulaScreenName) { | 269 WizardController::kEulaScreenName) { |
268 AutomationJSONReply(this, reply_message).SendError( | 270 AutomationJSONReply(this, reply_message).SendError( |
269 "EULA screen not active."); | 271 "EULA screen not active."); |
270 return; | 272 return; |
271 } | 273 } |
272 // Observer will delete itself. | 274 // Observer will delete itself. |
273 new WizardControllerObserver(wizard_controller, this, reply_message); | 275 new WizardControllerObserver(wizard_controller, this, reply_message); |
274 wizard_controller->GetEulaScreen()->OnExit(accepted, usage_stats_reporting); | 276 wizard_controller->GetEulaScreen()->OnExit( |
| 277 accepted, usage_stats_reporting, rlz_enabled); |
275 } | 278 } |
276 | 279 |
277 void TestingAutomationProvider::CancelOOBEUpdate(DictionaryValue* args, | 280 void TestingAutomationProvider::CancelOOBEUpdate(DictionaryValue* args, |
278 IPC::Message* reply_message) { | 281 IPC::Message* reply_message) { |
279 WizardController* wizard_controller = WizardController::default_controller(); | 282 WizardController* wizard_controller = WizardController::default_controller(); |
280 if (wizard_controller && wizard_controller->IsOobeCompleted()) { | 283 if (wizard_controller && wizard_controller->IsOobeCompleted()) { |
281 // Update already finished. | 284 // Update already finished. |
282 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); | 285 scoped_ptr<DictionaryValue> return_value(new DictionaryValue); |
283 return_value->SetString("next_screen", | 286 return_value->SetString("next_screen", |
284 WizardController::kLoginScreenName); | 287 WizardController::kLoginScreenName); |
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1492 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1495 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1493 AddObserver(power_manager_observer_); | 1496 AddObserver(power_manager_observer_); |
1494 } | 1497 } |
1495 | 1498 |
1496 void TestingAutomationProvider::RemoveChromeosObservers() { | 1499 void TestingAutomationProvider::RemoveChromeosObservers() { |
1497 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 1500 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
1498 RemoveObserver(power_manager_observer_); | 1501 RemoveObserver(power_manager_observer_); |
1499 delete power_manager_observer_; | 1502 delete power_manager_observer_; |
1500 power_manager_observer_ = NULL; | 1503 power_manager_observer_ = NULL; |
1501 } | 1504 } |
OLD | NEW |