Chromium Code Reviews| Index: webkit/glue/webaccessibility.cc |
| diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc |
| index 4626d99b1f1ee276a10af16b23127eff980783b1..6eb0d69cbc6de91bbf541e8d66acaa114c9e5600 100644 |
| --- a/webkit/glue/webaccessibility.cc |
| +++ b/webkit/glue/webaccessibility.cc |
| @@ -26,6 +26,11 @@ |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
| #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
| +#ifndef NDEBUG |
| +#include "content/common/view_messages.h" |
| +#endif |
| + |
|
brettw
2011/09/16 04:52:23
Extra blank line here.
David Tseng
2011/09/19 16:02:45
Done.
|
| + |
| using base::DoubleToString; |
| using base::IntToString; |
| using WebKit::WebAccessibilityCache; |
| @@ -335,10 +340,86 @@ WebAccessibility::~WebAccessibility() { |
| } |
| #ifndef NDEBUG |
| -std::string WebAccessibility::DebugString(bool recursive) { |
| +std::string WebAccessibility::DebugString(bool recursive, |
| + int render_routing_id, |
|
brettw
2011/09/16 04:52:23
These should be aligned with the "bool" on the pre
David Tseng
2011/09/19 16:02:45
Done.
|
| + int notification) { |
| std::string result; |
| static int indent = 0; |
| + if (render_routing_id != 0) { |
| + ViewHostMsg_AccEvent::Value notification_type = |
| + static_cast<ViewHostMsg_AccEvent::Value>(notification); |
| + result+= "routing id: "; |
|
brettw
2011/09/16 04:52:23
There should be a space before the "+" on each of
David Tseng
2011/09/19 16:02:45
Done; had done this to minimize spacing (bad style
|
| + result+= IntToString(render_routing_id); |
| + result+= " notification: "; |
| + |
| + switch (notification_type) { |
| + case ViewHostMsg_AccEvent::ACTIVE_DESCENDANT_CHANGED: |
| + result+= "active descendant changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::ALERT: |
| + result+= "alert"; |
| + break; |
| + case ViewHostMsg_AccEvent::CHECK_STATE_CHANGED: |
| + result+= "checked state changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::CHILDREN_CHANGED: |
| + result+= "children changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::FOCUS_CHANGED: |
| + result+= "focus changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::LAYOUT_COMPLETE: |
| + result+= "layout complete"; |
| + break; |
| + case ViewHostMsg_AccEvent::LIVE_REGION_CHANGED: |
| + result+= "live region changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::LOAD_COMPLETE: |
| + result+= "load complete"; |
| + break; |
| + case ViewHostMsg_AccEvent::MENU_LIST_VALUE_CHANGED: |
| + result+= "menu list changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::OBJECT_SHOW: |
| + result+= "object show"; |
| + break; |
| + case ViewHostMsg_AccEvent::OBJECT_HIDE: |
| + result+= "object hide"; |
| + break; |
| + case ViewHostMsg_AccEvent::ROW_COUNT_CHANGED: |
| + result+= "row count changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::ROW_COLLAPSED: |
| + result+= "row collapsed"; |
| + break; |
| + case ViewHostMsg_AccEvent::ROW_EXPANDED: |
| + result+= "row expanded"; |
| + break; |
| + case ViewHostMsg_AccEvent::SCROLLED_TO_ANCHOR: |
| + result+= "scrolled to anchor"; |
| + break; |
| + case ViewHostMsg_AccEvent::SELECTED_CHILDREN_CHANGED: |
| + result+= "selected children changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::SELECTED_TEXT_CHANGED: |
| + result+= "selected text changed"; |
| + break; |
| + case ViewHostMsg_AccEvent::TEXT_INSERTED: |
| + result+= "text inserted"; |
| + break; |
| + case ViewHostMsg_AccEvent::TEXT_REMOVED: |
| + result+= "text removed"; |
| + break; |
| + case ViewHostMsg_AccEvent::VALUE_CHANGED: |
| + result+= "value changed"; |
| + break; |
| + default: |
| + NOTREACHED(); |
| + } |
| + } |
| + |
| + result += "\n"; |
| for (int i = 0; i < indent; ++i) |
| result += " "; |
| @@ -675,7 +756,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; |
| } |