Fix web_contents focus handling.
On mac_views_browser fix bugs:
1. Return focus to location_bar throught "TAB"(key) pressing.
2. Saving focus on tabs(in tab_strip_model) swithing.
By handle associated methods in ChromeWebContentsViewDelegateViewsMac.
Make all focus changes in WebContentsView:
1. Move FocusThroughTabTraversal realization from WebContentsImpl to
WebContentsView.
2. Remove SetInitialFocus realizaton from WebContentsViewDelegate.
Reset stored focused view on any web_contens focus changing.
[email protected]
Bug: 782715
Cq-Include-Trybots: master.tryserver.chromium.linux:linux_site_isolation
Change-Id: I1ec95b655f7b5ee52fcc3a8cfea617a1ccab6f02
Reviewed-on: https://chromium-review.googlesource.com/758401
Reviewed-by: Trent Apted <[email protected]>
Reviewed-by: Bo <[email protected]>
Reviewed-by: Ted Choc <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Trent Apted <[email protected]>
Cr-Commit-Position: refs/heads/master@{#517745}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 63a63b48..85e33d93 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3233,17 +3233,7 @@
}
void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
- if (ShowingInterstitialPage()) {
- interstitial_page_->FocusThroughTabTraversal(reverse);
- return;
- }
- RenderWidgetHostView* const fullscreen_view =
- GetFullscreenRenderWidgetHostView();
- if (fullscreen_view) {
- fullscreen_view->Focus();
- return;
- }
- GetRenderViewHost()->SetInitialFocus(reverse);
+ view_->FocusThroughTabTraversal(reverse);
}
bool WebContentsImpl::ShowingInterstitialPage() const {
@@ -3256,7 +3246,7 @@
delegate_->AdjustPreviewsStateForNavigation(previews_state);
}
-InterstitialPage* WebContentsImpl::GetInterstitialPage() const {
+InterstitialPageImpl* WebContentsImpl::GetInterstitialPage() const {
return interstitial_page_;
}