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

Side by Side Diff: content/browser/web_contents/web_contents_view_guest.cc

Issue 13647006: Move webview size information into RWHVGuest. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 8 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
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/web_contents/web_contents_view_guest.h" 5 #include "content/browser/web_contents/web_contents_view_guest.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "content/browser/browser_plugin/browser_plugin_guest.h" 8 #include "content/browser/browser_plugin/browser_plugin_guest.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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 if (!rwhv) 44 if (!rwhv)
45 return NULL; 45 return NULL;
46 return rwhv->GetNativeView(); 46 return rwhv->GetNativeView();
47 } 47 }
48 48
49 gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const { 49 gfx::NativeWindow WebContentsViewGuest::GetTopLevelNativeWindow() const {
50 return guest_->embedder_web_contents()->GetView()->GetTopLevelNativeWindow(); 50 return guest_->embedder_web_contents()->GetView()->GetTopLevelNativeWindow();
51 } 51 }
52 52
53 void WebContentsViewGuest::GetContainerBounds(gfx::Rect* out) const { 53 void WebContentsViewGuest::GetContainerBounds(gfx::Rect* out) const {
54 platform_view_->GetContainerBounds(out); 54 out->SetRect(0, 0, size_.width(), size_.height());
55 } 55 }
56 56
57 void WebContentsViewGuest::SizeContents(const gfx::Size& size) { 57 void WebContentsViewGuest::SizeContents(const gfx::Size& size) {
58 platform_view_->SizeContents(size); 58 size_ = size;
59 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
60 if (rwhv)
61 rwhv->SetSize(size);
59 } 62 }
60 63
61 void WebContentsViewGuest::SetInitialFocus() { 64 void WebContentsViewGuest::SetInitialFocus() {
62 platform_view_->SetInitialFocus(); 65 platform_view_->SetInitialFocus();
63 } 66 }
64 67
65 gfx::Rect WebContentsViewGuest::GetViewBounds() const { 68 gfx::Rect WebContentsViewGuest::GetViewBounds() const {
66 return platform_view_->GetViewBounds(); 69 return gfx::Rect(size_);
67 } 70 }
68 71
69 #if defined(OS_MACOSX) 72 #if defined(OS_MACOSX)
70 void WebContentsViewGuest::SetAllowOverlappingViews(bool overlapping) { 73 void WebContentsViewGuest::SetAllowOverlappingViews(bool overlapping) {
71 platform_view_->SetAllowOverlappingViews(overlapping); 74 platform_view_->SetAllowOverlappingViews(overlapping);
72 } 75 }
73 #endif 76 #endif
74 77
75 void WebContentsViewGuest::CreateView(const gfx::Size& initial_size, 78 void WebContentsViewGuest::CreateView(const gfx::Size& initial_size,
76 gfx::NativeView context) { 79 gfx::NativeView context) {
77 platform_view_->CreateView(initial_size, context); 80 platform_view_->CreateView(initial_size, context);
81 size_ = initial_size;
78 } 82 }
79 83
80 RenderWidgetHostView* WebContentsViewGuest::CreateViewForWidget( 84 RenderWidgetHostView* WebContentsViewGuest::CreateViewForWidget(
81 RenderWidgetHost* render_widget_host) { 85 RenderWidgetHost* render_widget_host) {
82 if (render_widget_host->GetView()) { 86 if (render_widget_host->GetView()) {
83 // During testing, the view will already be set up in most cases to the 87 // During testing, the view will already be set up in most cases to the
84 // test view, so we don't want to clobber it with a real one. To verify that 88 // test view, so we don't want to clobber it with a real one. To verify that
85 // this actually is happening (and somebody isn't accidentally creating the 89 // this actually is happening (and somebody isn't accidentally creating the
86 // view twice), we check for the RVH Factory, which will be set when we're 90 // view twice), we check for the RVH Factory, which will be set when we're
87 // making special ones (which go along with the special views). 91 // making special ones (which go along with the special views).
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 void WebContentsViewGuest::StartDragging( 188 void WebContentsViewGuest::StartDragging(
185 const WebDropData& drop_data, 189 const WebDropData& drop_data,
186 WebDragOperationsMask ops, 190 WebDragOperationsMask ops,
187 const gfx::ImageSkia& image, 191 const gfx::ImageSkia& image,
188 const gfx::Vector2d& image_offset, 192 const gfx::Vector2d& image_offset,
189 const DragEventSourceInfo& event_info) { 193 const DragEventSourceInfo& event_info) {
190 NOTIMPLEMENTED(); 194 NOTIMPLEMENTED();
191 } 195 }
192 196
193 } // namespace content 197 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698