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

Unified Diff: chrome/browser/accessibility/accessibility_extension_api.cc

Issue 2789583004: Add a color argument to accessibilityPrivate.setFocusRing (Closed)
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/accessibility/accessibility_extension_api.cc
diff --git a/chrome/browser/accessibility/accessibility_extension_api.cc b/chrome/browser/accessibility/accessibility_extension_api.cc
index 504c126139a40723e0b530b7cad28541d77ef47c..62abc25566768286c5c722d2896334b09bbf0b2b 100644
--- a/chrome/browser/accessibility/accessibility_extension_api.cc
+++ b/chrome/browser/accessibility/accessibility_extension_api.cc
@@ -25,6 +25,7 @@
#include "extensions/browser/extension_system.h"
#include "extensions/browser/lazy_background_task_queue.h"
#include "extensions/common/error_utils.h"
+#include "extensions/common/image_util.h"
#include "extensions/common/manifest_handlers/background_info.h"
#if defined(OS_CHROMEOS)
@@ -82,6 +83,16 @@ AccessibilityPrivateSetFocusRingFunction::Run() {
rects.push_back(gfx::Rect(left, top, width, height));
}
+ std::string color_str;
+ if (args_->GetSize() >= 2 && args_->GetString(1, &color_str)) {
+ SkColor color;
+ if (!extensions::image_util::ParseHexColorString(color_str, &color))
+ return RespondNow(Error("Could not parse hex color"));
+ AccessibilityFocusRingController::GetInstance()->SetFocusRingColor(color);
+ } else {
+ AccessibilityFocusRingController::GetInstance()->ResetFocusRingColor();
+ }
+
// Move the visible focus ring to cover all of these rects.
AccessibilityFocusRingController::GetInstance()->SetFocusRing(
rects, AccessibilityFocusRingController::PERSIST_FOCUS_RING);
« no previous file with comments | « no previous file | chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698