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

Side by Side Diff: chrome/browser/accessibility/accessibility_extension_api.cc

Issue 2007863004: Fix the double-tap to click gesture in touch accessibility mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO for second display Created 4 years, 6 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 (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/accessibility/accessibility_extension_api.h" 5 #include "chrome/browser/accessibility/accessibility_extension_api.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 base::DictionaryValue* rect_value = NULL; 70 base::DictionaryValue* rect_value = NULL;
71 EXTENSION_FUNCTION_VALIDATE(rect_values->GetDictionary(i, &rect_value)); 71 EXTENSION_FUNCTION_VALIDATE(rect_values->GetDictionary(i, &rect_value));
72 int left, top, width, height; 72 int left, top, width, height;
73 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kLeft, &left)); 73 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kLeft, &left));
74 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kTop, &top)); 74 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kTop, &top));
75 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kWidth, &width)); 75 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kWidth, &width));
76 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kHeight, &height)); 76 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(kHeight, &height));
77 rects.push_back(gfx::Rect(left, top, width, height)); 77 rects.push_back(gfx::Rect(left, top, width, height));
78 } 78 }
79 79
80 // Move the visible focus ring to cover all of these rects.
80 chromeos::AccessibilityFocusRingController::GetInstance()->SetFocusRing( 81 chromeos::AccessibilityFocusRingController::GetInstance()->SetFocusRing(
81 rects); 82 rects);
83
84 // Also update the touch exploration controller so that synthesized
85 // touch events are anchored within the focused object.
86 if (!rects.empty()) {
87 chromeos::AccessibilityManager* manager =
88 chromeos::AccessibilityManager::Get();
89 manager->SetTouchAccessibilityAnchorPoint(rects[0].CenterPoint());
90 }
91
82 return true; 92 return true;
83 #endif // defined(OS_CHROMEOS) 93 #endif // defined(OS_CHROMEOS)
84 94
85 error_ = kErrorNotSupported; 95 error_ = kErrorNotSupported;
86 return false; 96 return false;
87 } 97 }
88 98
89 ExtensionFunction::ResponseAction 99 ExtensionFunction::ResponseAction
90 AccessibilityPrivateSetKeyboardListenerFunction::Run() { 100 AccessibilityPrivateSetKeyboardListenerFunction::Run() {
91 ChromeExtensionFunctionDetails details(this); 101 ChromeExtensionFunctionDetails details(this);
(...skipping 19 matching lines...) Expand all
111 } else { 121 } else {
112 manager->SetKeyboardListenerExtensionId(std::string(), 122 manager->SetKeyboardListenerExtensionId(std::string(),
113 details.GetProfile()); 123 details.GetProfile());
114 manager->set_keyboard_listener_capture(false); 124 manager->set_keyboard_listener_capture(false);
115 } 125 }
116 return RespondNow(NoArguments()); 126 return RespondNow(NoArguments());
117 #endif // defined OS_CHROMEOS 127 #endif // defined OS_CHROMEOS
118 128
119 return RespondNow(Error(kErrorNotSupported)); 129 return RespondNow(Error(kErrorNotSupported));
120 } 130 }
OLDNEW
« no previous file with comments | « ash/root_window_controller.cc ('k') | chrome/browser/chromeos/accessibility/accessibility_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698