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

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

Issue 10382222: Cache accessibility description rather than returning temporary. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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
« no previous file with comments | « content/browser/accessibility/browser_accessibility_gtk.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_gtk.cc
diff --git a/content/browser/accessibility/browser_accessibility_gtk.cc b/content/browser/accessibility/browser_accessibility_gtk.cc
index c852e98388eeb7f8a068a8c3dd2818dcae1cc718..5f2a490a4b3cb5145e4bb9d707d222e9b1681bcf 100644
--- a/content/browser/accessibility/browser_accessibility_gtk.cc
+++ b/content/browser/accessibility/browser_accessibility_gtk.cc
@@ -43,9 +43,7 @@ static const gchar* browser_accessibility_get_name(AtkObject* atk_object) {
static const gchar* browser_accessibility_get_description(
AtkObject* atk_object) {
BrowserAccessibilityGtk* obj = ToBrowserAccessibilityGtk(atk_object);
- string16 description;
- obj->GetStringAttribute(WebAccessibility::ATTR_DESCRIPTION, &description);
- return UTF16ToUTF8(description).c_str();
+ return obj->atk_acc_description().c_str();
}
static AtkObject* browser_accessibility_get_parent(AtkObject* atk_object) {
@@ -313,7 +311,11 @@ bool BrowserAccessibilityGtk::IsNative() const {
}
void BrowserAccessibilityGtk::InitRoleAndState() {
- atk_acc_name_ = UTF16ToUTF8(name()).c_str();
+ atk_acc_name_ = UTF16ToUTF8(name());
+
+ string16 description;
+ GetStringAttribute(WebAccessibility::ATTR_DESCRIPTION, &description);
+ atk_acc_description_ = UTF16ToUTF8(description);
switch(role_) {
case WebAccessibility::ROLE_BUTTON:
« no previous file with comments | « content/browser/accessibility/browser_accessibility_gtk.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698