Fixes browser_tests with --enable-text-input-focus-manager enabled.

http://crrev.com/173803002 introduced WebView::NotifyMaybeTextInputClientChanged, but the CL missed some cases.  We should be aware of more cases that the underlying web_contents may change.
- When an interstitial page is attached / detached
- When the render process is gone

browser_tests are broken with these cases when --enable-text-input-focus-manager enabled.  This CL fixes the broken tests.

BUG=290701
TEST=Run browser_tests with --enable-text-input-focus-manager enabled.

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@278861 0039d316-1c4b-4281-b951-d872f2087c98
parent 50f5ff68
...@@ -252,6 +252,10 @@ void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) { ...@@ -252,6 +252,10 @@ void WebView::RenderViewDeleted(content::RenderViewHost* render_view_host) {
NotifyMaybeTextInputClientChanged(); NotifyMaybeTextInputClientChanged();
} }
void WebView::RenderProcessGone(base::TerminationStatus status) {
NotifyMaybeTextInputClientChanged();
}
void WebView::RenderViewHostChanged(content::RenderViewHost* old_host, void WebView::RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) { content::RenderViewHost* new_host) {
FocusManager* const focus_manager = GetFocusManager(); FocusManager* const focus_manager = GetFocusManager();
...@@ -275,6 +279,14 @@ void WebView::DidToggleFullscreenModeForTab(bool entered_fullscreen) { ...@@ -275,6 +279,14 @@ void WebView::DidToggleFullscreenModeForTab(bool entered_fullscreen) {
ReattachForFullscreenChange(entered_fullscreen); ReattachForFullscreenChange(entered_fullscreen);
} }
void WebView::DidAttachInterstitialPage() {
NotifyMaybeTextInputClientChanged();
}
void WebView::DidDetachInterstitialPage() {
NotifyMaybeTextInputClientChanged();
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// WebView, private: // WebView, private:
......
...@@ -117,12 +117,15 @@ class WEBVIEW_EXPORT WebView : public View, ...@@ -117,12 +117,15 @@ class WEBVIEW_EXPORT WebView : public View,
// Overridden from content::WebContentsObserver: // Overridden from content::WebContentsObserver:
virtual void RenderViewDeleted( virtual void RenderViewDeleted(
content::RenderViewHost* render_view_host) OVERRIDE; content::RenderViewHost* render_view_host) OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
virtual void RenderViewHostChanged( virtual void RenderViewHostChanged(
content::RenderViewHost* old_host, content::RenderViewHost* old_host,
content::RenderViewHost* new_host) OVERRIDE; content::RenderViewHost* new_host) OVERRIDE;
virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE; virtual void DidShowFullscreenWidget(int routing_id) OVERRIDE;
virtual void DidDestroyFullscreenWidget(int routing_id) OVERRIDE; virtual void DidDestroyFullscreenWidget(int routing_id) OVERRIDE;
virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) OVERRIDE; virtual void DidToggleFullscreenModeForTab(bool entered_fullscreen) OVERRIDE;
virtual void DidAttachInterstitialPage() OVERRIDE;
virtual void DidDetachInterstitialPage() OVERRIDE;
// Workaround for MSVC++ linker bug/feature that requires // Workaround for MSVC++ linker bug/feature that requires
// instantiation of the inline IPC::Listener methods in all translation units. // instantiation of the inline IPC::Listener methods in all translation units.
virtual void OnChannelConnected(int32 peer_id) OVERRIDE {} virtual void OnChannelConnected(int32 peer_id) OVERRIDE {}
......
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