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

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10830187: Prevent Flash from dropping focus on fullscreen change (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_win.cc
===================================================================
--- content/browser/renderer_host/render_widget_host_view_win.cc (revision 149690)
+++ content/browser/renderer_host/render_widget_host_view_win.cc (working copy)
@@ -661,6 +661,7 @@
void RenderWidgetHostViewWin::InitAsPopup(
RenderWidgetHostView* parent_host_view, const gfx::Rect& pos) {
+ close_on_deactivate_ = true;
DoPopupOrFullscreenInit(parent_host_view->GetNativeView(), pos,
WS_EX_TOOLWINDOW);
}
@@ -1617,7 +1618,8 @@
if (render_widget_host_)
render_widget_host_->LostCapture();
- if (close_on_deactivate_ && !weak_factory_.HasWeakPtrs()) {
+ if ((is_fullscreen_ || close_on_deactivate_) &&
+ !weak_factory_.HasWeakPtrs()) {
// Dismiss popups and menus. We do this asynchronously to avoid changing
// activation within this callstack, which may interfere with another window
// being activated. We can synchronously hide the window, but we need to
@@ -1887,7 +1889,7 @@
// RenderViewHostHWND as there is no way to retrieve it from the HWND.
// Don't forward if the container is a popup or fullscreen widget.
- if (!close_on_deactivate_) {
+ if (!is_fullscreen_ && !close_on_deactivate_) {
switch (message) {
case WM_LBUTTONDOWN:
case WM_MBUTTONDOWN:
@@ -1942,7 +1944,7 @@
// parent.
// TODO(jcampan): http://b/issue?id=1192881 Could be abstracted in the
// FocusManager.
- if (close_on_deactivate_ && !is_fullscreen_ &&
+ if (close_on_deactivate_ &&
(((message == WM_KEYDOWN || message == WM_KEYUP) && (wparam == VK_TAB)) ||
(message == WM_CHAR && wparam == L'\t'))) {
// First close the pop-up.
@@ -2951,7 +2953,6 @@
void RenderWidgetHostViewWin::DoPopupOrFullscreenInit(HWND parent_hwnd,
const gfx::Rect& pos,
DWORD ex_style) {
- close_on_deactivate_ = true;
Create(parent_hwnd, NULL, NULL, WS_POPUP, ex_style);
MoveWindow(pos.x(), pos.y(), pos.width(), pos.height(), TRUE);
ShowWindow(IsActivatable() ? SW_SHOW : SW_SHOWNA);
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698