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

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

Issue 10832011: Makes NativeViewHostWin change the parent of the hwnd when (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix focus issues Created 8 years, 5 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 | « no previous file | ui/base/win/hidden_window.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_view_win.cc
diff --git a/content/browser/web_contents/web_contents_view_win.cc b/content/browser/web_contents/web_contents_view_win.cc
index 8f14e28a811594b3f1991e03c2bfb0ed775d5378..23a0734551973349be08d789cd533736bc2f5867 100644
--- a/content/browser/web_contents/web_contents_view_win.cc
+++ b/content/browser/web_contents/web_contents_view_win.cc
@@ -15,6 +15,7 @@
#include "content/browser/web_contents/web_drag_dest_win.h"
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/browser/web_contents_view_delegate.h"
+#include "ui/base/win/hidden_window.h"
#include "ui/base/win/hwnd_subclass.h"
#include "ui/gfx/screen.h"
@@ -37,43 +38,6 @@ WebContentsView* CreateWebContentsView(
namespace {
-// We need to have a parent window for the compositing code to work correctly.
-//
-// A tab will not have a parent HWND whenever it is not active in its
-// host window - for example at creation time and when it's in the
-// background, so we provide a default widget to host them.
-//
-// It may be tempting to use GetDesktopWindow() instead, but this is
-// problematic as the shell sends messages to children of the desktop
-// window that interact poorly with us.
-//
-// See: http://crbug.com/16476
-class TempParent : public ui::WindowImpl {
- public:
- static TempParent* Get() {
- static TempParent* g_temp_parent;
- if (!g_temp_parent) {
- g_temp_parent = new TempParent();
-
- g_temp_parent->set_window_style(WS_POPUP);
- g_temp_parent->set_window_ex_style(WS_EX_TOOLWINDOW);
- g_temp_parent->Init(GetDesktopWindow(), gfx::Rect());
- EnableWindow(g_temp_parent->hwnd(), FALSE);
- }
- return g_temp_parent;
- }
-
- private:
- // Explicitly do nothing in Close. We do this as some external apps may get a
- // handle to this window and attempt to close it.
- void OnClose() {
- }
-
- BEGIN_MSG_MAP_EX(WebContentsViewWin)
- MSG_WM_CLOSE(OnClose)
- END_MSG_MAP()
-};
-
typedef std::map<HWND, WebContentsViewWin*> HwndToWcvMap;
HwndToWcvMap hwnd_to_wcv_map;
@@ -151,7 +115,7 @@ void WebContentsViewWin::CreateView(const gfx::Size& initial_size) {
set_window_style(WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
- Init(TempParent::Get()->hwnd(), gfx::Rect(initial_size_));
+ Init(ui::GetHiddenWindow(), gfx::Rect(initial_size_));
// Remove the root view drop target so we can register our own.
RevokeDragDrop(GetNativeView());
« no previous file with comments | « no previous file | ui/base/win/hidden_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698