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

Unified Diff: chrome/browser/renderer_host/render_widget_host.cc

Issue 2720003: Relanding 49339 ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 6 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
Index: chrome/browser/renderer_host/render_widget_host.cc
===================================================================
--- chrome/browser/renderer_host/render_widget_host.cc (revision 49343)
+++ chrome/browser/renderer_host/render_widget_host.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "base/auto_reset.h"
+#include "base/command_line.h"
#include "base/histogram.h"
#include "base/keyboard_codes.h"
#include "base/message_loop.h"
@@ -16,6 +17,7 @@
#include "chrome/browser/renderer_host/render_widget_host_painting_observer.h"
#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/renderer_host/video_layer.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/render_messages.h"
#include "webkit/glue/webcursor.h"
@@ -58,6 +60,9 @@
// in trailing scrolls after the user ends their input.
static const int kMaxTimeBetweenWheelMessagesMs = 250;
+// static
+bool RenderWidgetHost::renderer_accessible_ = false;
+
///////////////////////////////////////////////////////////////////////////////
// RenderWidgetHost
@@ -1111,6 +1116,35 @@
Send(new ViewMsg_GetAccessibilityTree(routing_id()));
}
+void RenderWidgetHost::SetDocumentLoaded(bool document_loaded) {
+ document_loaded_ = document_loaded;
+
+ if (!document_loaded_)
+ requested_accessibility_tree_ = false;
+
+ if (renderer_accessible_ && document_loaded_) {
+ RequestAccessibilityTree();
+ requested_accessibility_tree_ = true;
+ }
+}
+
+void RenderWidgetHost::EnableRendererAccessibility() {
+ if (renderer_accessible_)
+ return;
+
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableRendererAccessibility)) {
+ return;
+ }
+
+ renderer_accessible_ = true;
+
+ if (document_loaded_ && !requested_accessibility_tree_) {
+ RequestAccessibilityTree();
+ requested_accessibility_tree_ = true;
+ }
+}
+
void RenderWidgetHost::SetAccessibilityFocus(int acc_obj_id) {
Send(new ViewMsg_SetAccessibilityFocus(routing_id(), acc_obj_id));
}
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host.h ('k') | chrome/browser/renderer_host/render_widget_host_view_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698