diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 21:03:56 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-21 21:03:56 +0000 |
commit | 2e11765ef682220b05d2cd16e5b92d09dde86de0 (patch) | |
tree | ae76d1f77205e1f5d04ebe9c7b6b80f8b440ef3b /webkit/glue | |
parent | 5bc109335743e7e01310cd1741764821e44129f0 (diff) | |
download | chromium_src-2e11765ef682220b05d2cd16e5b92d09dde86de0.zip chromium_src-2e11765ef682220b05d2cd16e5b92d09dde86de0.tar.gz chromium_src-2e11765ef682220b05d2cd16e5b92d09dde86de0.tar.bz2 |
Add routing id and notification type to accessibility logging.
BUG=none
TEST=manual.
Review URL: http://codereview.chromium.org/7867018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102167 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue')
-rw-r--r-- | webkit/glue/webaccessibility.cc | 76 | ||||
-rw-r--r-- | webkit/glue/webaccessibility.h | 4 |
2 files changed, 77 insertions, 3 deletions
diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc index 4626d99..b888133 100644 --- a/webkit/glue/webaccessibility.cc +++ b/webkit/glue/webaccessibility.cc @@ -26,12 +26,20 @@ #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" +#ifndef NDEBUG +#include "third_party/WebKit/Source/WebKit/chromium/public/WebAccessibilityNotification.h" +#endif + using base::DoubleToString; using base::IntToString; using WebKit::WebAccessibilityCache; using WebKit::WebAccessibilityRole; using WebKit::WebAccessibilityObject; +#ifndef NDEBUG +using WebKit::WebAccessibilityNotification; +#endif + namespace { std::string IntVectorToString(const std::vector<int>& items) { @@ -335,10 +343,74 @@ WebAccessibility::~WebAccessibility() { } #ifndef NDEBUG -std::string WebAccessibility::DebugString(bool recursive) { +std::string WebAccessibility::DebugString(bool recursive, + int render_routing_id, + int notification) { std::string result; static int indent = 0; + if (render_routing_id != 0) { + WebKit::WebAccessibilityNotification notification_type = + static_cast<WebKit::WebAccessibilityNotification>(notification); + result += "routing id="; + result += IntToString(render_routing_id); + result += " notification="; + + switch (notification_type) { + case WebKit::WebAccessibilityNotificationActiveDescendantChanged: + result += "active descendant changed"; + break; + case WebKit::WebAccessibilityNotificationCheckedStateChanged: + result += "check state changed"; + break; + case WebKit::WebAccessibilityNotificationChildrenChanged: + result += "children changed"; + break; + case WebKit::WebAccessibilityNotificationFocusedUIElementChanged: + result += "focus changed"; + break; + case WebKit::WebAccessibilityNotificationLayoutComplete: + result += "layout complete"; + break; + case WebKit::WebAccessibilityNotificationLiveRegionChanged: + result += "live region changed"; + break; + case WebKit::WebAccessibilityNotificationLoadComplete: + result += "load complete"; + break; + case WebKit::WebAccessibilityNotificationMenuListValueChanged: + result += "menu list changed"; + break; + case WebKit::WebAccessibilityNotificationRowCountChanged: + result += "row count changed"; + break; + case WebKit::WebAccessibilityNotificationRowCollapsed: + result += "row collapsed"; + break; + case WebKit::WebAccessibilityNotificationRowExpanded: + result += "row expanded"; + break; + case WebKit::WebAccessibilityNotificationScrolledToAnchor: + result += "scrolled to anchor"; + break; + case WebKit::WebAccessibilityNotificationSelectedChildrenChanged: + result += "selected children changed"; + break; + case WebKit::WebAccessibilityNotificationSelectedTextChanged: + result += "selected text changed"; + break; + case WebKit::WebAccessibilityNotificationValueChanged: + result += "value changed"; + break; + case WebKit::WebAccessibilityNotificationInvalid: + result += "invalid notification"; + break; + default: + NOTREACHED(); + } + } + + result += "\n"; for (int i = 0; i < indent; ++i) result += " "; @@ -675,7 +747,7 @@ std::string WebAccessibility::DebugString(bool recursive) { result += "\n"; ++indent; for (size_t i = 0; i < children.size(); ++i) - result += children[i].DebugString(true); + result += children[i].DebugString(true, 0, 0); --indent; } diff --git a/webkit/glue/webaccessibility.h b/webkit/glue/webaccessibility.h index ceaa516..f0ca423 100644 --- a/webkit/glue/webaccessibility.h +++ b/webkit/glue/webaccessibility.h @@ -248,7 +248,9 @@ struct WebAccessibility { ~WebAccessibility(); #ifndef NDEBUG - std::string DebugString(bool recursive); + std::string DebugString(bool recursive, + int render_routing_id, + int notification_type); #endif private: |