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

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

Issue 600063002: Draw a focus ring around native views when ChromeVox is running. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add check for Chrome OS Created 6 years, 2 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 "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h" 10 #include "chrome/browser/accessibility/accessibility_extension_api_constants.h"
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 bool AccessibilityPrivateSetFocusRingFunction::RunSync() { 316 bool AccessibilityPrivateSetFocusRingFunction::RunSync() {
317 #if defined(OS_CHROMEOS) 317 #if defined(OS_CHROMEOS)
318 base::ListValue* rect_values = NULL; 318 base::ListValue* rect_values = NULL;
319 EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &rect_values)); 319 EXTENSION_FUNCTION_VALIDATE(args_->GetList(0, &rect_values));
320 320
321 std::vector<gfx::Rect> rects; 321 std::vector<gfx::Rect> rects;
322 for (size_t i = 0; i < rect_values->GetSize(); ++i) { 322 for (size_t i = 0; i < rect_values->GetSize(); ++i) {
323 base::DictionaryValue* rect_value = NULL; 323 base::DictionaryValue* rect_value = NULL;
324 EXTENSION_FUNCTION_VALIDATE(rect_values->GetDictionary(i, &rect_value)); 324 EXTENSION_FUNCTION_VALIDATE(rect_values->GetDictionary(i, &rect_value));
325 int left, top, width, height; 325 int left, top, width, height;
326 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger("left", &left)); 326 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(keys::kLeft, &left));
327 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger("top", &top)); 327 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(keys::kTop, &top));
328 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger("width", &width)); 328 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(keys::kWidth, &width));
329 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger("height", &height)); 329 EXTENSION_FUNCTION_VALIDATE(rect_value->GetInteger(keys::kHeight, &height));
330 rects.push_back(gfx::Rect(left, top, width, height)); 330 rects.push_back(gfx::Rect(left, top, width, height));
331 } 331 }
332 332
333 chromeos::AccessibilityFocusRingController::GetInstance()->SetFocusRing( 333 chromeos::AccessibilityFocusRingController::GetInstance()->SetFocusRing(
334 rects); 334 rects);
335 return true; 335 return true;
336 #endif // defined(OS_CHROMEOS) 336 #endif // defined(OS_CHROMEOS)
337 337
338 error_ = keys:: kErrorNotSupported; 338 error_ = keys:: kErrorNotSupported;
339 return false; 339 return false;
340 } 340 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698