summaryrefslogtreecommitdiffstats
path: root/chrome/browser/render_widget_host_view_win.cc
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 15:29:03 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-10-17 15:29:03 +0000
commit15787f8f3946a513d39a1f0d9a12925f447fa18d (patch)
tree9f68bab4d2682376d7d11ec42024f67823470427 /chrome/browser/render_widget_host_view_win.cc
parent0d05594d912d67dcbcd5b899a1036819603922b1 (diff)
downloadchromium_src-15787f8f3946a513d39a1f0d9a12925f447fa18d.zip
chromium_src-15787f8f3946a513d39a1f0d9a12925f447fa18d.tar.gz
chromium_src-15787f8f3946a513d39a1f0d9a12925f447fa18d.tar.bz2
Separate out most view creation from WebContents. This adds a new sub-delegate to RenderViewHostDelegate which is implemented by WebContentsView. I did a lot of plumbing and moving around as a result.
Review URL: http://codereview.chromium.org/6608 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3527 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_widget_host_view_win.cc')
-rw-r--r--chrome/browser/render_widget_host_view_win.cc23
1 files changed, 21 insertions, 2 deletions
diff --git a/chrome/browser/render_widget_host_view_win.cc b/chrome/browser/render_widget_host_view_win.cc
index db70018..32d6d55 100644
--- a/chrome/browser/render_widget_host_view_win.cc
+++ b/chrome/browser/render_widget_host_view_win.cc
@@ -50,13 +50,21 @@ BOOL CALLBACK DismissOwnedPopups(HWND window, LPARAM arg) {
} // namespace
+// RenderWidgetHostView --------------------------------------------------------
+
+// static
+RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(
+ RenderWidgetHost* widget) {
+ return new RenderWidgetHostViewWin(widget);
+}
+
///////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewWin, public:
RenderWidgetHostViewWin::RenderWidgetHostViewWin(
- RenderWidgetHost* render_widget_host)
+ RenderWidgetHost* widget)
: RenderWidgetHostView(),
- render_widget_host_(render_widget_host),
+ render_widget_host_(widget),
real_cursor_(LoadCursor(NULL, IDC_ARROW)),
real_cursor_type_(WebCursor::ARROW),
track_mouse_leave_(false),
@@ -68,6 +76,13 @@ RenderWidgetHostViewWin::RenderWidgetHostViewWin(
shutdown_factory_(this),
parent_hwnd_(NULL),
is_loading_(false) {
+ render_widget_host_->set_view(this);
+
+ // We set the parent HWND explicitly as pop-up HWNDs are parented and owned by
+ // the first non-child HWND of the HWND that was specified to the CreateWindow
+ // call.
+ set_parent_hwnd(GetPluginHWND());
+ set_close_on_deactivate(true);
}
RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
@@ -79,6 +94,10 @@ RenderWidgetHostViewWin::~RenderWidgetHostViewWin() {
///////////////////////////////////////////////////////////////////////////////
// RenderWidgetHostViewWin, RenderWidgetHostView implementation:
+RenderWidgetHost* RenderWidgetHostViewWin::GetRenderWidgetHost() const {
+ return render_widget_host_;
+}
+
void RenderWidgetHostViewWin::DidBecomeSelected() {
if (!is_hidden_)
return;