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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java

Issue 1137393003: Add style information to the snapshot node (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add content dependency to ui_accessibility_java for GN Created 5 years, 7 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
Index: content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
index a4a404a52d7c7aed0965f9c5c3ad9b853f9148b1..e655e957d5523aacd483f47825edd04e3df24471 100644
--- a/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
+++ b/content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java
@@ -14,6 +14,7 @@ import org.chromium.content_public.browser.JavaScriptCallback;
import org.chromium.content_public.browser.NavigationController;
import org.chromium.content_public.browser.WebContents;
import org.chromium.content_public.browser.WebContentsObserver;
+import org.chromium.ui.accessibility.AXTextStyle;
/**
* The WebContentsImpl Java wrapper to allow communicating with the native WebContentsImpl
@@ -234,9 +235,19 @@ import org.chromium.content_public.browser.WebContentsObserver;
@CalledByNative
private static AccessibilitySnapshotNode createAccessibilitySnapshotNode(int x,
int y, int scrollX, int scrollY, int width, int height, String text,
- String className) {
- return new AccessibilitySnapshotNode(x, y, scrollX, scrollY, width, height, text,
- className);
+ int color, int bgcolor, float size, int textStyle, String className) {
+
+ AccessibilitySnapshotNode node = new AccessibilitySnapshotNode(x, y, scrollX,
+ scrollY, width, height, text, className);
+ // if size is smaller than 0, then style information does not exist.
+ if (size >= 0.0) {
+ boolean bold = (textStyle & AXTextStyle.text_style_bold) > 0;
+ boolean italic = (textStyle & AXTextStyle.text_style_italic) > 0;
+ boolean underline = (textStyle & AXTextStyle.text_style_underline) > 0;
+ boolean lineThrough = (textStyle & AXTextStyle.text_style_line_through) > 0;
+ node.setStyle(color, bgcolor, size, bold, italic, underline, lineThrough);
+ }
+ return node;
}
@Override

Powered by Google App Engine
This is Rietveld 408576698