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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 670653005: Fix Flash fullscreen focus regressions, and add interactive_ui_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove consts in ObjC code. Created 6 years, 2 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: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4ce4f972db0f278193541181710e527129cdb364..e6ee4cf2a1f398cd19129e468fd44eebe6cad981 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -1286,6 +1286,15 @@ void WebContentsImpl::RenderWidgetDeleted(
}
}
+void WebContentsImpl::RenderWidgetGotFocus(
+ RenderWidgetHostImpl* render_widget_host) {
+ // Notify the delegate if an embedded fullscreen widget was focused.
+ if (delegate_ && render_widget_host &&
+ delegate_->EmbedsFullscreenWidget() &&
+ render_widget_host->GetView() == GetFullscreenRenderWidgetHostView())
+ delegate_->WebContentsFocused(this);
+}
+
bool WebContentsImpl::PreHandleKeyboardEvent(
const NativeWebKeyboardEvent& event,
bool* is_keyboard_shortcut) {
@@ -2100,35 +2109,19 @@ DropData* WebContentsImpl::GetDropData() {
}
void WebContentsImpl::Focus() {
- RenderWidgetHostView* const fullscreen_view =
- GetFullscreenRenderWidgetHostView();
- if (fullscreen_view)
- fullscreen_view->Focus();
- else
- view_->Focus();
+ view_->Focus();
}
void WebContentsImpl::SetInitialFocus() {
- RenderWidgetHostView* const fullscreen_view =
- GetFullscreenRenderWidgetHostView();
- if (fullscreen_view)
- fullscreen_view->Focus();
- else
- view_->SetInitialFocus();
+ view_->SetInitialFocus();
}
void WebContentsImpl::StoreFocus() {
- if (!GetFullscreenRenderWidgetHostView())
- view_->StoreFocus();
+ view_->StoreFocus();
}
void WebContentsImpl::RestoreFocus() {
- RenderWidgetHostView* const fullscreen_view =
- GetFullscreenRenderWidgetHostView();
- if (fullscreen_view)
- fullscreen_view->Focus();
- else
- view_->RestoreFocus();
+ view_->RestoreFocus();
}
void WebContentsImpl::FocusThroughTabTraversal(bool reverse) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698