Commit 2e11765e authored by dtseng@chromium.org's avatar dtseng@chromium.org

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
parent 5bc10933
...@@ -1626,8 +1626,10 @@ void RenderView::SendPendingAccessibilityNotifications() { ...@@ -1626,8 +1626,10 @@ void RenderView::SendPendingAccessibilityNotifications() {
#ifndef NDEBUG #ifndef NDEBUG
if (accessibility_logging_) { if (accessibility_logging_) {
LOG(INFO) << "Accessibility update: \n" LOG(INFO) << "Accessibility update:\n"
<< param.acc_obj.DebugString(true); << param.acc_obj.DebugString(true,
routing_id_,
pending_accessibility_notifications_[i].type);
} }
#endif #endif
} }
......
...@@ -26,12 +26,20 @@ ...@@ -26,12 +26,20 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.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::DoubleToString;
using base::IntToString; using base::IntToString;
using WebKit::WebAccessibilityCache; using WebKit::WebAccessibilityCache;
using WebKit::WebAccessibilityRole; using WebKit::WebAccessibilityRole;
using WebKit::WebAccessibilityObject; using WebKit::WebAccessibilityObject;
#ifndef NDEBUG
using WebKit::WebAccessibilityNotification;
#endif
namespace { namespace {
std::string IntVectorToString(const std::vector<int>& items) { std::string IntVectorToString(const std::vector<int>& items) {
...@@ -335,10 +343,74 @@ WebAccessibility::~WebAccessibility() { ...@@ -335,10 +343,74 @@ WebAccessibility::~WebAccessibility() {
} }
#ifndef NDEBUG #ifndef NDEBUG
std::string WebAccessibility::DebugString(bool recursive) { std::string WebAccessibility::DebugString(bool recursive,
int render_routing_id,
int notification) {
std::string result; std::string result;
static int indent = 0; 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) for (int i = 0; i < indent; ++i)
result += " "; result += " ";
...@@ -675,7 +747,7 @@ std::string WebAccessibility::DebugString(bool recursive) { ...@@ -675,7 +747,7 @@ std::string WebAccessibility::DebugString(bool recursive) {
result += "\n"; result += "\n";
++indent; ++indent;
for (size_t i = 0; i < children.size(); ++i) for (size_t i = 0; i < children.size(); ++i)
result += children[i].DebugString(true); result += children[i].DebugString(true, 0, 0);
--indent; --indent;
} }
......
...@@ -248,7 +248,9 @@ struct WebAccessibility { ...@@ -248,7 +248,9 @@ struct WebAccessibility {
~WebAccessibility(); ~WebAccessibility();
#ifndef NDEBUG #ifndef NDEBUG
std::string DebugString(bool recursive); std::string DebugString(bool recursive,
int render_routing_id,
int notification_type);
#endif #endif
private: private:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment