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

Side by Side Diff: chrome/browser/extensions/api/automation_internal/automation_internal_api.cc

Issue 2768703002: Wire up an api to darken screen for accessibility (Closed)
Patch Set: Cvox changes. Created 3 years, 9 months 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
OLDNEW
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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 case api::automation_internal::ACTION_TYPE_SETACCESSIBILITYFOCUS: { 371 case api::automation_internal::ACTION_TYPE_SETACCESSIBILITYFOCUS: {
372 action->action = ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS; 372 action->action = ui::AX_ACTION_SET_ACCESSIBILITY_FOCUS;
373 break; 373 break;
374 } 374 }
375 case api::automation_internal:: 375 case api::automation_internal::
376 ACTION_TYPE_SETSEQUENTIALFOCUSNAVIGATIONSTARTINGPOINT: { 376 ACTION_TYPE_SETSEQUENTIALFOCUSNAVIGATIONSTARTINGPOINT: {
377 action->action = 377 action->action =
378 ui::AX_ACTION_SET_SEQUENTIAL_FOCUS_NAVIGATION_STARTING_POINT; 378 ui::AX_ACTION_SET_SEQUENTIAL_FOCUS_NAVIGATION_STARTING_POINT;
379 break; 379 break;
380 } 380 }
381 case api::automation_internal::ACTION_TYPE_TOGGLEDARKENSCREEN: {
382 action->action = ui::AX_ACTION_TOGGLE_DARKEN_SCREEN;
383 api::automation_internal::ToggleDarkenScreenParams darken_params;
384 EXTENSION_FUNCTION_VALIDATE(
385 api::automation_internal::ToggleDarkenScreenParams::Populate(
386 params->opt_args.additional_properties, &darken_params));
387 action->AddBoolAttribute(ui::AX_ACTION_ATTR_DARKEN_SCREEN,
388 darken_params.darken_screen);
389 break;
390 }
381 default: 391 default:
382 NOTREACHED(); 392 NOTREACHED();
383 } 393 }
384 return RespondNow(NoArguments()); 394 return RespondNow(NoArguments());
385 } 395 }
386 396
387 ExtensionFunction::ResponseAction 397 ExtensionFunction::ResponseAction
388 AutomationInternalPerformActionFunction::Run() { 398 AutomationInternalPerformActionFunction::Run() {
389 const AutomationInfo* automation_info = AutomationInfo::Get(extension()); 399 const AutomationInfo* automation_info = AutomationInfo::Get(extension());
390 EXTENSION_FUNCTION_VALIDATE(automation_info && automation_info->interact); 400 EXTENSION_FUNCTION_VALIDATE(automation_info && automation_info->interact);
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 int result_acc_obj_id) { 519 int result_acc_obj_id) {
510 if (!error.empty()) { 520 if (!error.empty()) {
511 Respond(Error(error)); 521 Respond(Error(error));
512 return; 522 return;
513 } 523 }
514 524
515 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id))); 525 Respond(OneArgument(base::MakeUnique<base::Value>(result_acc_obj_id)));
516 } 526 }
517 527
518 } // namespace extensions 528 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698