Index: chrome/browser/automation/testing_automation_provider_chromeos.cc |
diff --git a/chrome/browser/automation/testing_automation_provider_chromeos.cc b/chrome/browser/automation/testing_automation_provider_chromeos.cc |
index 000677fc80e57fb1a11be389e342e0de3872166a..116c610dbee83c94d81621983afd9b216b121c2f 100644 |
--- a/chrome/browser/automation/testing_automation_provider_chromeos.cc |
+++ b/chrome/browser/automation/testing_automation_provider_chromeos.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/automation/testing_automation_provider.h" |
+#include "ash/accelerators/accelerator_controller.h" |
#include "ash/shell.h" |
#include "ash/shell_delegate.h" |
#include "ash/system/tray/system_tray_delegate.h" |
@@ -1450,6 +1451,23 @@ void TestingAutomationProvider::CaptureProfilePhoto( |
window->Show(); |
} |
+void TestingAutomationProvider::ApplyAshAccelerator( |
+ base::DictionaryValue* args, |
+ IPC::Message* reply_message) { |
+ int action; |
+ AutomationJSONReply reply(this, reply_message); |
+ if (!args->GetInteger("action", &action)) |
+ reply.SendError("Invalid or missing args."); |
+ |
+ bool handled = |
+ ash::Shell::GetInstance()->accelerator_controller()->PerformAction( |
+ action, ui::Accelerator()); |
+ |
+ DictionaryValue result; |
+ result.SetBoolean("handled", handled); |
+ reply.SendSuccess(&result); |
+} |
+ |
void TestingAutomationProvider::AddChromeosObservers() { |
power_manager_observer_ = new PowerManagerClientObserverForTesting; |
chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |