OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/api/automation_internal/automation_internal_ api.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_ api.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
454 ui::AXActionData data; | 454 ui::AXActionData data; |
455 ExtensionFunction::ResponseAction result = | 455 ExtensionFunction::ResponseAction result = |
456 ConvertToAXActionData(params.get(), &data); | 456 ConvertToAXActionData(params.get(), &data); |
457 rfh->AccessibilityPerformAction(data); | 457 rfh->AccessibilityPerformAction(data); |
458 return result; | 458 return result; |
459 } | 459 } |
460 | 460 |
461 ExtensionFunction::ResponseAction | 461 ExtensionFunction::ResponseAction |
462 AutomationInternalEnableDesktopFunction::Run() { | 462 AutomationInternalEnableDesktopFunction::Run() { |
463 #if defined(USE_AURA) | 463 #if defined(USE_AURA) |
464 content::BrowserAccessibilityState::GetInstance()->EnableAccessibility(); | |
David Tseng
2017/04/06 16:45:43
I don't understand why this is necessary if the ho
dmazzoni
2017/04/06 19:26:03
I'm open to other solutions but I couldn't come up
David Tseng
2017/04/06 20:00:32
What happened with storing the child tree id as a
dmazzoni
2017/04/07 23:34:08
OK, see latest patch set. I figured out a way to d
| |
465 | |
464 const AutomationInfo* automation_info = AutomationInfo::Get(extension()); | 466 const AutomationInfo* automation_info = AutomationInfo::Get(extension()); |
465 if (!automation_info || !automation_info->desktop) | 467 if (!automation_info || !automation_info->desktop) |
466 return RespondNow(Error("desktop permission must be requested")); | 468 return RespondNow(Error("desktop permission must be requested")); |
467 | 469 |
468 using api::automation_internal::EnableDesktop::Params; | 470 using api::automation_internal::EnableDesktop::Params; |
469 std::unique_ptr<Params> params(Params::Create(*args_)); | 471 std::unique_ptr<Params> params(Params::Create(*args_)); |
470 EXTENSION_FUNCTION_VALIDATE(params.get()); | 472 EXTENSION_FUNCTION_VALIDATE(params.get()); |
471 | 473 |
472 // This gets removed when the extension process dies. | 474 // This gets removed when the extension process dies. |
473 AutomationEventRouter::GetInstance()->RegisterListenerWithDesktopPermission( | 475 AutomationEventRouter::GetInstance()->RegisterListenerWithDesktopPermission( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
520 int result_acc_obj_id) { | 522 int result_acc_obj_id) { |
521 if (!error.empty()) { | 523 if (!error.empty()) { |
522 Respond(Error(error)); | 524 Respond(Error(error)); |
523 return; | 525 return; |
524 } | 526 } |
525 | 527 |
526 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); | 528 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); |
527 } | 529 } |
528 | 530 |
529 } // namespace extensions | 531 } // namespace extensions |
OLD | NEW |