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

Side by Side Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 1768753003: Implemented the reporting of text style and language information on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated to using HashTable from base and GetInheritedStringAttribute instead of specialized methods… Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/accessibility/browser_accessibility_android.h" 5 #include "content/browser/accessibility/browser_accessibility_android.h"
6 6
7 #include "base/i18n/break_iterator.h" 7 #include "base/i18n/break_iterator.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 case ui::AX_ROLE_COMBO_BOX: 350 case ui::AX_ROLE_COMBO_BOX:
351 case ui::AX_ROLE_POP_UP_BUTTON: 351 case ui::AX_ROLE_POP_UP_BUTTON:
352 case ui::AX_ROLE_TEXT_FIELD: 352 case ui::AX_ROLE_TEXT_FIELD:
353 return value; 353 return value;
354 } 354 }
355 } 355 }
356 356
357 // For color wells, the color is stored in separate attributes. 357 // For color wells, the color is stored in separate attributes.
358 // Perhaps we could return color names in the future? 358 // Perhaps we could return color names in the future?
359 if (GetRole() == ui::AX_ROLE_COLOR_WELL) { 359 if (GetRole() == ui::AX_ROLE_COLOR_WELL) {
360 int color = GetIntAttribute(ui::AX_ATTR_COLOR_VALUE); 360 unsigned int color =
361 int red = (color >> 16) & 0xFF; 361 static_cast<unsigned int>(GetIntAttribute(ui::AX_ATTR_COLOR_VALUE));
362 int green = (color >> 8) & 0xFF; 362 unsigned int red, green, blue, alpha;
363 int blue = color & 0xFF; 363 RGBAToColorValues(color, &red, &green, &blue, &alpha);
364 return base::UTF8ToUTF16( 364 return base::UTF8ToUTF16(
365 base::StringPrintf("#%02X%02X%02X", red, green, blue)); 365 base::StringPrintf("#%02X%02X%02X", red, green, blue));
366 } 366 }
367 367
368 base::string16 text = GetString16Attribute(ui::AX_ATTR_NAME); 368 base::string16 text = GetString16Attribute(ui::AX_ATTR_NAME);
369 base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION); 369 base::string16 description = GetString16Attribute(ui::AX_ATTR_DESCRIPTION);
370 if (!description.empty()) { 370 if (!description.empty()) {
371 if (!text.empty()) 371 if (!text.empty())
372 text += base::ASCIIToUTF16(" "); 372 text += base::ASCIIToUTF16(" ");
373 text += description; 373 text += description;
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1379 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 1379 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
1380 int count = 0; 1380 int count = 0;
1381 for (uint32_t i = 0; i < PlatformChildCount(); i++) { 1381 for (uint32_t i = 0; i < PlatformChildCount(); i++) {
1382 if (PlatformGetChild(i)->GetRole() == role) 1382 if (PlatformGetChild(i)->GetRole() == role)
1383 count++; 1383 count++;
1384 } 1384 }
1385 return count; 1385 return count;
1386 } 1386 }
1387 1387
1388 } // namespace content 1388 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698