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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 std::unique_ptr<Params> params(Params::Create(*args_)); | 408 std::unique_ptr<Params> params(Params::Create(*args_)); |
409 EXTENSION_FUNCTION_VALIDATE(params.get()); | 409 EXTENSION_FUNCTION_VALIDATE(params.get()); |
410 ui::AXTreeIDRegistry* registry = ui::AXTreeIDRegistry::GetInstance(); | 410 ui::AXTreeIDRegistry* registry = ui::AXTreeIDRegistry::GetInstance(); |
411 ui::AXHostDelegate* delegate = | 411 ui::AXHostDelegate* delegate = |
412 registry->GetHostDelegate(params->args.tree_id); | 412 registry->GetHostDelegate(params->args.tree_id); |
413 if (delegate) { | 413 if (delegate) { |
414 #if defined(USE_AURA) | 414 #if defined(USE_AURA) |
415 ui::AXActionData data; | 415 ui::AXActionData data; |
416 ConvertToAXActionData(params.get(), &data); | 416 ConvertToAXActionData(params.get(), &data); |
417 delegate->PerformAction(data); | 417 delegate->PerformAction(data); |
| 418 return RespondNow(NoArguments()); |
418 #else | 419 #else |
419 NOTREACHED(); | 420 NOTREACHED(); |
420 return RespondNow(Error("Unexpected action on desktop automation tree;" | 421 return RespondNow(Error("Unexpected action on desktop automation tree;" |
421 " platform does not support desktop automation")); | 422 " platform does not support desktop automation")); |
422 #endif // defined(USE_AURA) | 423 #endif // defined(USE_AURA) |
423 } | 424 } |
424 content::RenderFrameHost* rfh = | 425 content::RenderFrameHost* rfh = |
425 content::RenderFrameHost::FromAXTreeID(params->args.tree_id); | 426 content::RenderFrameHost::FromAXTreeID(params->args.tree_id); |
426 if (!rfh) | 427 if (!rfh) |
427 return RespondNow(Error("Ignoring action on destroyed node")); | 428 return RespondNow(Error("Ignoring action on destroyed node")); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 int result_acc_obj_id) { | 525 int result_acc_obj_id) { |
525 if (!error.empty()) { | 526 if (!error.empty()) { |
526 Respond(Error(error)); | 527 Respond(Error(error)); |
527 return; | 528 return; |
528 } | 529 } |
529 | 530 |
530 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); | 531 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); |
531 } | 532 } |
532 | 533 |
533 } // namespace extensions | 534 } // namespace extensions |
OLD | NEW |