OLD | NEW |
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/web_contents/web_contents_view_win.h" | 5 #include "content/browser/web_contents/web_contents_view_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "content/browser/renderer_host/render_view_host_factory.h" | 9 #include "content/browser/renderer_host/render_view_host_factory.h" |
10 #include "content/browser/renderer_host/render_view_host_impl.h" | 10 #include "content/browser/renderer_host/render_view_host_impl.h" |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 132 } |
133 | 133 |
134 view_ = static_cast<RenderWidgetHostViewWin*>( | 134 view_ = static_cast<RenderWidgetHostViewWin*>( |
135 RenderWidgetHostView::CreateViewForWidget(render_widget_host)); | 135 RenderWidgetHostView::CreateViewForWidget(render_widget_host)); |
136 view_->CreateWnd(GetNativeView()); | 136 view_->CreateWnd(GetNativeView()); |
137 view_->ShowWindow(SW_SHOW); | 137 view_->ShowWindow(SW_SHOW); |
138 view_->SetSize(initial_size_); | 138 view_->SetSize(initial_size_); |
139 return view_; | 139 return view_; |
140 } | 140 } |
141 | 141 |
| 142 void WebContentsViewWin::SetView(RenderWidgetHostView* view) { |
| 143 view_ = static_cast<RenderWidgetHostViewWin*>(view); |
| 144 } |
| 145 |
142 gfx::NativeView WebContentsViewWin::GetNativeView() const { | 146 gfx::NativeView WebContentsViewWin::GetNativeView() const { |
143 return hwnd(); | 147 return hwnd(); |
144 } | 148 } |
145 | 149 |
146 gfx::NativeView WebContentsViewWin::GetContentNativeView() const { | 150 gfx::NativeView WebContentsViewWin::GetContentNativeView() const { |
147 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); | 151 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); |
148 return rwhv ? rwhv->GetNativeView() : NULL; | 152 return rwhv ? rwhv->GetNativeView() : NULL; |
149 } | 153 } |
150 | 154 |
151 gfx::NativeWindow WebContentsViewWin::GetTopLevelNativeWindow() const { | 155 gfx::NativeWindow WebContentsViewWin::GetTopLevelNativeWindow() const { |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 si.nPage = 10; | 476 si.nPage = 10; |
473 si.nPos = 50; | 477 si.nPos = 50; |
474 | 478 |
475 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); | 479 ::SetScrollInfo(hwnd(), SB_HORZ, &si, FALSE); |
476 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); | 480 ::SetScrollInfo(hwnd(), SB_VERT, &si, FALSE); |
477 | 481 |
478 return 1; | 482 return 1; |
479 } | 483 } |
480 | 484 |
481 } // namespace content | 485 } // namespace content |
OLD | NEW |