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

Unified Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 1130733006: Adds color, font size, text direction and text styles to the accessibility tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation error. 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/browser/accessibility/browser_accessibility_win.cc
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 74994bd94aa4882f768d713dd2bfa72dc3f247d5..3d5907bb173dc076a05db267e23dc92230483243 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -605,16 +605,14 @@ STDMETHODIMP BrowserAccessibilityWin::get_accValue(VARIANT var_id,
// Expose color well value.
if (target->ia2_role() == IA2_ROLE_COLOR_CHOOSER) {
- int r = target->GetIntAttribute(
- ui::AX_ATTR_COLOR_VALUE_RED);
- int g = target->GetIntAttribute(
- ui::AX_ATTR_COLOR_VALUE_GREEN);
- int b = target->GetIntAttribute(
- ui::AX_ATTR_COLOR_VALUE_BLUE);
+ int color = target->GetIntAttribute(ui::AX_ATTR_COLOR_VALUE);
+ int red = (color >> 16) & 0xFF;
+ int green = (color >> 8) & 0xFF;
+ int blue = color & 0xFF;
base::string16 value_text;
- value_text = base::IntToString16((r * 100) / 255) + L"% red " +
- base::IntToString16((g * 100) / 255) + L"% green " +
- base::IntToString16((b * 100) / 255) + L"% blue";
+ value_text = base::IntToString16((red * 100) / 255) + L"% red " +
+ base::IntToString16((green * 100) / 255) + L"% green " +
+ base::IntToString16((blue * 100) / 255) + L"% blue";
*value = SysAllocString(value_text.c_str());
DCHECK(*value);
return S_OK;

Powered by Google App Engine
This is Rietveld 408576698