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

Unified Diff: webkit/glue/webaccessibility.cc

Issue 7867018: Add routing id and notification type to accessibility logging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: indent. Created 9 years, 3 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 | « webkit/glue/webaccessibility.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/webaccessibility.cc
diff --git a/webkit/glue/webaccessibility.cc b/webkit/glue/webaccessibility.cc
index 4626d99b1f1ee276a10af16b23127eff980783b1..b8881330da3c0a6f416e2b9ce4a881a72c5995c1 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;
}
« no previous file with comments | « webkit/glue/webaccessibility.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698