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

Side by Side Diff: content/browser/tab_contents/tab_contents_view_win.cc

Issue 9473001: Extract minimal RenderViewHost interface for embedders, leaving (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to LKGR. Created 8 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/tab_contents_view_win.h" 5 #include "content/browser/tab_contents/tab_contents_view_win.h"
6 6
7 #include "content/browser/renderer_host/render_view_host.h" 7 #include "content/browser/renderer_host/render_view_host.h"
8 #include "content/browser/renderer_host/render_view_host_factory.h" 8 #include "content/browser/renderer_host/render_view_host_factory.h"
9 #include "content/browser/renderer_host/render_widget_host_view_win.h" 9 #include "content/browser/renderer_host/render_widget_host_view_win.h"
10 #include "content/browser/tab_contents/interstitial_page_impl.h" 10 #include "content/browser/tab_contents/interstitial_page_impl.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 void TabContentsViewWin::CreateView(const gfx::Size& initial_size) { 68 void TabContentsViewWin::CreateView(const gfx::Size& initial_size) {
69 initial_size_ = initial_size; 69 initial_size_ = initial_size;
70 70
71 set_window_style(WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS); 71 set_window_style(WS_VISIBLE | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
72 72
73 Init(TempParent::Get()->hwnd(), gfx::Rect(initial_size_)); 73 Init(TempParent::Get()->hwnd(), gfx::Rect(initial_size_));
74 } 74 }
75 75
76 RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget( 76 RenderWidgetHostView* TabContentsViewWin::CreateViewForWidget(
77 RenderWidgetHost* render_widget_host) { 77 RenderWidgetHost* render_widget_host) {
78 if (render_widget_host->view()) { 78 if (render_widget_host->GetView()) {
79 // During testing, the view will already be set up in most cases to the 79 // During testing, the view will already be set up in most cases to the
80 // test view, so we don't want to clobber it with a real one. To verify that 80 // test view, so we don't want to clobber it with a real one. To verify that
81 // this actually is happening (and somebody isn't accidentally creating the 81 // this actually is happening (and somebody isn't accidentally creating the
82 // view twice), we check for the RVH Factory, which will be set when we're 82 // view twice), we check for the RVH Factory, which will be set when we're
83 // making special ones (which go along with the special views). 83 // making special ones (which go along with the special views).
84 DCHECK(RenderViewHostFactory::has_factory()); 84 DCHECK(RenderViewHostFactory::has_factory());
85 return render_widget_host->view(); 85 return render_widget_host->GetView();
86 } 86 }
87 87
88 view_ = static_cast<RenderWidgetHostViewWin*>( 88 view_ = static_cast<RenderWidgetHostViewWin*>(
89 RenderWidgetHostView::CreateViewForWidget(render_widget_host)); 89 RenderWidgetHostView::CreateViewForWidget(render_widget_host));
90 view_->CreateWnd(GetNativeView()); 90 view_->CreateWnd(GetNativeView());
91 view_->ShowWindow(SW_SHOW); 91 view_->ShowWindow(SW_SHOW);
92 view_->SetSize(initial_size_); 92 view_->SetSize(initial_size_);
93 return view_; 93 return view_;
94 } 94 }
95 95
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 gfx::Size size(window_pos->cx, window_pos->cy); 291 gfx::Size size(window_pos->cx, window_pos->cy);
292 if (tab_contents_->GetInterstitialPage()) 292 if (tab_contents_->GetInterstitialPage())
293 tab_contents_->GetInterstitialPage()->SetSize(size); 293 tab_contents_->GetInterstitialPage()->SetSize(size);
294 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView(); 294 RenderWidgetHostView* rwhv = tab_contents_->GetRenderWidgetHostView();
295 if (rwhv) 295 if (rwhv)
296 rwhv->SetSize(size); 296 rwhv->SetSize(size);
297 297
298 return 0; 298 return 0;
299 } 299 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents_view_helper.cc ('k') | content/browser/tab_contents/test_tab_contents.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698