Commit 370aa218 authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Get rid of enable-accessibility-logging switch.

This also cleans up the main VLOG in renderer_accessibility_complete so
that it uses the new function in ui to convert an AXEvent to a string,
and removes the NDEBUG since this is quite useful logging in release builds.

Instead of the old switch, use --vmodule="*accessibility*=0" to log
accessibility messages that are normally suppressed, possibly combined
with --enable-logging=stderr to send them right to your terminal and
--log-level=2 to optionally suppress most other log messages.

BUG=350457
R=aboxhall@chromium.org, jam@chromium.org

Review URL: https://codereview.chromium.org/284203005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@271046 0039d316-1c4b-4281-b951-d872f2087c98
parent 90c03338
...@@ -1061,7 +1061,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( ...@@ -1061,7 +1061,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDomAutomationController, switches::kDomAutomationController,
switches::kEnableAcceleratedFixedRootBackground, switches::kEnableAcceleratedFixedRootBackground,
switches::kEnableAcceleratedOverflowScroll, switches::kEnableAcceleratedOverflowScroll,
switches::kEnableAccessibilityLogging,
switches::kEnableADTSStreamParser, switches::kEnableADTSStreamParser,
switches::kEnableBeginFrameScheduling, switches::kEnableBeginFrameScheduling,
switches::kEnableBleedingEdgeRenderingFastPaths, switches::kEnableBleedingEdgeRenderingFastPaths,
......
...@@ -346,9 +346,6 @@ const char kEnableLayerSquashing[] = ...@@ -346,9 +346,6 @@ const char kEnableLayerSquashing[] =
// Enable experimental container node culling. // Enable experimental container node culling.
const char kEnableContainerCulling[] = "enable-container-culling"; const char kEnableContainerCulling[] = "enable-container-culling";
// Turns on extremely verbose logging of accessibility events.
const char kEnableAccessibilityLogging[] = "enable-accessibility-logging";
// Use a BeginFrame signal from browser to renderer to schedule rendering. // Use a BeginFrame signal from browser to renderer to schedule rendering.
const char kEnableBeginFrameScheduling[] = "enable-begin-frame-scheduling"; const char kEnableBeginFrameScheduling[] = "enable-begin-frame-scheduling";
......
...@@ -105,7 +105,6 @@ CONTENT_EXPORT extern const char kEnableAcceleratedFixedRootBackground[]; ...@@ -105,7 +105,6 @@ CONTENT_EXPORT extern const char kEnableAcceleratedFixedRootBackground[];
CONTENT_EXPORT extern const char kEnableAcceleratedOverflowScroll[]; CONTENT_EXPORT extern const char kEnableAcceleratedOverflowScroll[];
CONTENT_EXPORT extern const char kEnableLayerSquashing[]; CONTENT_EXPORT extern const char kEnableLayerSquashing[];
CONTENT_EXPORT extern const char kEnableContainerCulling[]; CONTENT_EXPORT extern const char kEnableContainerCulling[];
extern const char kEnableAccessibilityLogging[];
CONTENT_EXPORT extern const char kEnableBeginFrameScheduling[]; CONTENT_EXPORT extern const char kEnableBeginFrameScheduling[];
CONTENT_EXPORT extern const char kEnableCompositingForFixedPosition[]; CONTENT_EXPORT extern const char kEnableCompositingForFixedPosition[];
CONTENT_EXPORT extern const char kEnableCompositingForTransition[]; CONTENT_EXPORT extern const char kEnableCompositingForTransition[];
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#include "content/renderer/accessibility/renderer_accessibility.h" #include "content/renderer/accessibility/renderer_accessibility.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "content/public/common/content_switches.h"
#include "content/renderer/render_view_impl.h" #include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/web/WebAXObject.h" #include "third_party/WebKit/public/web/WebAXObject.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
...@@ -22,11 +21,7 @@ namespace content { ...@@ -22,11 +21,7 @@ namespace content {
RendererAccessibility::RendererAccessibility( RendererAccessibility::RendererAccessibility(
RenderViewImpl* render_view) RenderViewImpl* render_view)
: RenderViewObserver(render_view), : RenderViewObserver(render_view),
render_view_(render_view), render_view_(render_view) {
logging_(false) {
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kEnableAccessibilityLogging))
logging_ = true;
} }
RendererAccessibility::~RendererAccessibility() { RendererAccessibility::~RendererAccessibility() {
...@@ -42,83 +37,4 @@ WebDocument RendererAccessibility::GetMainDocument() { ...@@ -42,83 +37,4 @@ WebDocument RendererAccessibility::GetMainDocument() {
return WebDocument(); return WebDocument();
} }
#ifndef NDEBUG
const std::string RendererAccessibility::AccessibilityEventToString(
ui::AXEvent event) {
switch (event) {
case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED:
return "active descendant changed";
case ui::AX_EVENT_ARIA_ATTRIBUTE_CHANGED:
return "aria attribute changed";
case ui::AX_EVENT_ALERT:
return "alert";
case ui::AX_EVENT_AUTOCORRECTION_OCCURED:
return "autocorrection occurred";
case ui::AX_EVENT_BLUR:
return "blur";
case ui::AX_EVENT_CHECKED_STATE_CHANGED:
return "check state changed";
case ui::AX_EVENT_CHILDREN_CHANGED:
return "children changed";
case ui::AX_EVENT_FOCUS:
return "focus changed";
case ui::AX_EVENT_HIDE:
return "object hide";
case ui::AX_EVENT_INVALID_STATUS_CHANGED:
return "invalid status changed";
case ui::AX_EVENT_LAYOUT_COMPLETE:
return "layout complete";
case ui::AX_EVENT_LIVE_REGION_CHANGED:
return "live region changed";
case ui::AX_EVENT_LOAD_COMPLETE:
return "load complete";
case ui::AX_EVENT_LOCATION_CHANGED:
return "location changed";
case ui::AX_EVENT_MENU_END:
return "menu end";
case ui::AX_EVENT_MENU_LIST_ITEM_SELECTED:
return "menu list item selected";
case ui::AX_EVENT_MENU_LIST_VALUE_CHANGED:
return "menu list changed";
case ui::AX_EVENT_MENU_POPUP_END:
return "menu popup end";
case ui::AX_EVENT_MENU_POPUP_START:
return "menu popup start";
case ui::AX_EVENT_MENU_START:
return "menu start";
case ui::AX_EVENT_NONE:
return "none";
case ui::AX_EVENT_ROW_COLLAPSED:
return "row collapsed";
case ui::AX_EVENT_ROW_COUNT_CHANGED:
return "row count changed";
case ui::AX_EVENT_ROW_EXPANDED:
return "row expanded";
case ui::AX_EVENT_SCROLL_POSITION_CHANGED:
return "scroll position changed";
case ui::AX_EVENT_SCROLLED_TO_ANCHOR:
return "scrolled to anchor";
case ui::AX_EVENT_SELECTED_CHILDREN_CHANGED:
return "selected children changed";
case ui::AX_EVENT_SELECTED_TEXT_CHANGED:
return "selected text changed";
case ui::AX_EVENT_SELECTION_CHANGED:
return "selection changed";
case ui::AX_EVENT_SHOW:
return "object show";
case ui::AX_EVENT_TEXT_CHANGED:
return "text changed";
case ui::AX_EVENT_TEXT_INSERTED:
return "text inserted";
case ui::AX_EVENT_TEXT_REMOVED:
return "text removed";
case ui::AX_EVENT_VALUE_CHANGED:
return "value changed";
default:
NOTREACHED();
}
return "";
}
#endif
} // namespace content } // namespace content
...@@ -76,16 +76,9 @@ class CONTENT_EXPORT RendererAccessibility : public RenderViewObserver { ...@@ -76,16 +76,9 @@ class CONTENT_EXPORT RendererAccessibility : public RenderViewObserver {
// no view or frame. // no view or frame.
blink::WebDocument GetMainDocument(); blink::WebDocument GetMainDocument();
#ifndef NDEBUG
const std::string AccessibilityEventToString(ui::AXEvent event);
#endif
// The RenderViewImpl that owns us. // The RenderViewImpl that owns us.
RenderViewImpl* render_view_; RenderViewImpl* render_view_;
// True if verbose logging of accessibility events is on.
bool logging_;
DISALLOW_COPY_AND_ASSIGN(RendererAccessibility); DISALLOW_COPY_AND_ASSIGN(RendererAccessibility);
}; };
......
...@@ -201,13 +201,9 @@ void RendererAccessibilityComplete::SendPendingAccessibilityEvents() { ...@@ -201,13 +201,9 @@ void RendererAccessibilityComplete::SendPendingAccessibilityEvents() {
serializer_.SerializeChanges(obj, &event_msg.update); serializer_.SerializeChanges(obj, &event_msg.update);
event_msgs.push_back(event_msg); event_msgs.push_back(event_msg);
#ifndef NDEBUG VLOG(0) << "Accessibility event: " << ui::ToString(event.event_type)
VLOG(0) << "Accessibility update: \n" << " on node id " << event_msg.id
<< "routing id=" << routing_id()
<< " event="
<< AccessibilityEventToString(event.event_type)
<< "\n" << event_msg.update.ToString(); << "\n" << event_msg.update.ToString();
#endif
} }
Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs)); Send(new AccessibilityHostMsg_Events(routing_id(), event_msgs));
......
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