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

Unified Diff: ui/views/controls/webview/webview.cc

Issue 880063002: Ensure WebView notifies desktop automation on creation, destruction, and change (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Wait for start. Created 5 years, 11 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: ui/views/controls/webview/webview.cc
diff --git a/ui/views/controls/webview/webview.cc b/ui/views/controls/webview/webview.cc
index f695de4628382577e6b6c31b265673b9b7cace47..9d3c7d15b2be882214db2727344950fa39ae7947 100644
--- a/ui/views/controls/webview/webview.cc
+++ b/ui/views/controls/webview/webview.cc
@@ -78,7 +78,7 @@ void WebView::SetWebContents(content::WebContents* replacement) {
DCHECK(!is_embedding_fullscreen_widget_);
}
AttachWebContents();
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::SetEmbedFullscreenWidgetMode(bool enable) {
@@ -266,7 +266,7 @@ gfx::Size WebView::GetPreferredSize() const {
void WebView::RenderProcessExited(content::RenderProcessHost* host,
base::TerminationStatus status,
int exit_code) {
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::RenderProcessHostDestroyed(content::RenderProcessHost* host) {
@@ -292,11 +292,11 @@ bool WebView::EmbedsFullscreenWidget() const {
// WebView, content::WebContentsObserver implementation:
void WebView::RenderViewReady() {
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) {
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
@@ -304,7 +304,7 @@ void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
FocusManager* const focus_manager = GetFocusManager();
if (focus_manager && focus_manager->GetFocusedView() == this)
OnFocus();
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::WebContentsDestroyed() {
@@ -312,7 +312,7 @@ void WebView::WebContentsDestroyed() {
observing_render_process_host_->RemoveObserver(this);
observing_render_process_host_ = nullptr;
}
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::DidShowFullscreenWidget(int routing_id) {
@@ -331,11 +331,11 @@ void WebView::DidToggleFullscreenModeForTab(bool entered_fullscreen) {
}
void WebView::DidAttachInterstitialPage() {
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
void WebView::DidDetachInterstitialPage() {
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
////////////////////////////////////////////////////////////////////////////////
@@ -397,14 +397,18 @@ void WebView::ReattachForFullscreenChange(bool enter_fullscreen) {
// the same. So, do not change attachment.
OnBoundsChanged(bounds());
}
- NotifyMaybeTextInputClientChanged();
+ NotifyMaybeTextInputClientAndAccessibilityChanged();
}
-void WebView::NotifyMaybeTextInputClientChanged() {
+void WebView::NotifyMaybeTextInputClientAndAccessibilityChanged() {
// Update the TextInputClient as needed; see GetTextInputClient().
FocusManager* const focus_manager = GetFocusManager();
if (focus_manager)
focus_manager->OnTextInputClientChanged(this);
+
+#if defined(OS_CHROMEOS)
dmazzoni 2015/01/28 23:05:21 I think we should fire this event on all platforms
David Tseng 2015/01/29 00:33:51 Was getting various test failures specific to Wind
+ NotifyAccessibilityEvent(ui::AX_EVENT_CHILDREN_CHANGED, true);
+#endif // defined OS_CHROMEOS
}
content::WebContents* WebView::CreateWebContents(

Powered by Google App Engine
This is Rietveld 408576698