summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/web_contents.cc25
-rw-r--r--chrome/browser/tab_contents/web_contents_view.h8
-rw-r--r--chrome/browser/tab_contents/web_contents_view_win.cc2
-rw-r--r--chrome/browser/tab_contents/web_contents_view_win.h2
4 files changed, 16 insertions, 21 deletions
diff --git a/chrome/browser/tab_contents/web_contents.cc b/chrome/browser/tab_contents/web_contents.cc
index 8cc690f..4f4af00 100644
--- a/chrome/browser/tab_contents/web_contents.cc
+++ b/chrome/browser/tab_contents/web_contents.cc
@@ -29,7 +29,7 @@
#include "chrome/browser/plugin_service.h"
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/renderer_host/render_view_host.h"
-#include "chrome/browser/renderer_host/render_widget_host_view_win.h" // TODO(brettw) delete me.
+#include "chrome/browser/renderer_host/render_widget_host_view.h"
#include "chrome/browser/search_engines/template_url_fetcher.h"
#include "chrome/browser/search_engines/template_url_model.h"
#include "chrome/browser/tab_contents/navigation_entry.h"
@@ -1376,19 +1376,16 @@ void WebContents::UpdateRenderViewSizeForRenderManager() {
bool WebContents::CreateRenderViewForRenderManager(
RenderViewHost* render_view_host) {
- RenderWidgetHostView* rvh_view = view_->CreateViewForWidget(render_view_host);
-
- bool ok = render_view_host->CreateRenderView();
- if (ok) {
- // TODO(brettw) hack alert. Do this in some cross platform way, or move
- // to the view?
- RenderWidgetHostViewWin* rvh_view_win =
- static_cast<RenderWidgetHostViewWin*>(rvh_view);
- rvh_view->SetSize(view_->GetContainerSize());
- UpdateMaxPageIDIfNecessary(render_view_host->site_instance(),
- render_view_host);
- }
- return ok;
+ RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host);
+ if (!render_view_host->CreateRenderView())
+ return false;
+
+ // Now that the RenderView has been created, we need to tell it its size.
+ rwh_view->SetSize(view_->GetContainerSize());
+
+ UpdateMaxPageIDIfNecessary(render_view_host->site_instance(),
+ render_view_host);
+ return true;
}
void WebContents::Observe(NotificationType type,
diff --git a/chrome/browser/tab_contents/web_contents_view.h b/chrome/browser/tab_contents/web_contents_view.h
index 1db1a52..309a33d 100644
--- a/chrome/browser/tab_contents/web_contents_view.h
+++ b/chrome/browser/tab_contents/web_contents_view.h
@@ -18,7 +18,6 @@ class Browser;
class RenderViewHost;
class RenderWidgetHost;
class RenderWidgetHostView;
-class RenderWidgetHostViewWin; // TODO(brettw) this should not be necessary.
class WebContents;
struct WebDropData;
class WebKeyboardEvent;
@@ -43,10 +42,9 @@ class WebContentsView : public RenderViewHostDelegate::View {
virtual void CreateView() = 0;
// Sets up the View that holds the rendered web page, receives messages for
- // it and contains page plugins.
- // TODO(brettw) make this so we don't need to return the Win version (see the
- // caller in WebContents).
- virtual RenderWidgetHostViewWin* CreateViewForWidget(
+ // it and contains page plugins. The host view should be sized to the current
+ // size of the WebContents.
+ virtual RenderWidgetHostView* CreateViewForWidget(
RenderWidgetHost* render_widget_host) = 0;
// Returns the native widget that contains the contents of the tab.
diff --git a/chrome/browser/tab_contents/web_contents_view_win.cc b/chrome/browser/tab_contents/web_contents_view_win.cc
index f294d6a..e93916e 100644
--- a/chrome/browser/tab_contents/web_contents_view_win.cc
+++ b/chrome/browser/tab_contents/web_contents_view_win.cc
@@ -64,7 +64,7 @@ void WebContentsViewWin::CreateView() {
drop_target_ = new WebDropTarget(GetHWND(), web_contents_);
}
-RenderWidgetHostViewWin* WebContentsViewWin::CreateViewForWidget(
+RenderWidgetHostView* WebContentsViewWin::CreateViewForWidget(
RenderWidgetHost* render_widget_host) {
DCHECK(!render_widget_host->view());
RenderWidgetHostViewWin* view =
diff --git a/chrome/browser/tab_contents/web_contents_view_win.h b/chrome/browser/tab_contents/web_contents_view_win.h
index d891614..543efb4 100644
--- a/chrome/browser/tab_contents/web_contents_view_win.h
+++ b/chrome/browser/tab_contents/web_contents_view_win.h
@@ -30,7 +30,7 @@ class WebContentsViewWin : public WebContentsView,
virtual WebContents* GetWebContents();
virtual void CreateView();
- virtual RenderWidgetHostViewWin* CreateViewForWidget(
+ virtual RenderWidgetHostView* CreateViewForWidget(
RenderWidgetHost* render_widget_host);
virtual gfx::NativeView GetNativeView() const;
virtual gfx::NativeView GetContentNativeView() const;