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

Unified Diff: chrome/browser/tab_contents/web_contents.cc

Issue 19677: Clean up the Windows-ness in the sizing of new views. Write a bunch of commen... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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: chrome/browser/tab_contents/web_contents.cc
===================================================================
--- chrome/browser/tab_contents/web_contents.cc (revision 8895)
+++ chrome/browser/tab_contents/web_contents.cc (working copy)
@@ -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 @@
bool WebContents::CreateRenderViewForRenderManager(
RenderViewHost* render_view_host) {
- RenderWidgetHostView* rvh_view = view_->CreateViewForWidget(render_view_host);
+ RenderWidgetHostView* rwh_view = view_->CreateViewForWidget(render_view_host);
+ if (!render_view_host->CreateRenderView())
+ return false;
- 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;
+ // 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,
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view.h ('k') | chrome/browser/tab_contents/web_contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698