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

Side by Side Diff: content/browser/renderer_host/render_widget_host_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 "base/bind_helpers.h" 5 #include "base/bind_helpers.h"
6 #include "base/command_line.h" 6 #include "base/command_line.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/browser/browser_plugin/browser_plugin_guest.h" 9 #include "content/browser/browser_plugin/browser_plugin_guest.h"
10 #include "content/browser/renderer_host/render_view_host_impl.h" 10 #include "content/browser/renderer_host/render_view_host_impl.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 } 69 }
70 70
71 void RenderWidgetHostViewGuest::WasHidden() { 71 void RenderWidgetHostViewGuest::WasHidden() {
72 if (is_hidden_) 72 if (is_hidden_)
73 return; 73 return;
74 is_hidden_ = true; 74 is_hidden_ = true;
75 host_->WasHidden(); 75 host_->WasHidden();
76 } 76 }
77 77
78 void RenderWidgetHostViewGuest::SetSize(const gfx::Size& size) { 78 void RenderWidgetHostViewGuest::SetSize(const gfx::Size& size) {
79 platform_view_->SetSize(size); 79 size_ = size;
80 host_->WasResized();
80 } 81 }
81 82
82 gfx::Rect RenderWidgetHostViewGuest::GetBoundsInRootWindow() { 83 gfx::Rect RenderWidgetHostViewGuest::GetBoundsInRootWindow() {
83 return platform_view_->GetBoundsInRootWindow(); 84 return gfx::Rect(size_);
lazyboy 2013/04/04 19:29:43 This is probably not right, but I don't know where
84 } 85 }
85 86
86 gfx::GLSurfaceHandle RenderWidgetHostViewGuest::GetCompositingSurface() { 87 gfx::GLSurfaceHandle RenderWidgetHostViewGuest::GetCompositingSurface() {
87 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT); 88 return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT);
88 } 89 }
89 90
90 #if defined(OS_WIN) || defined(USE_AURA) 91 #if defined(OS_WIN) || defined(USE_AURA)
91 void RenderWidgetHostViewGuest::ProcessAckedTouchEvent( 92 void RenderWidgetHostViewGuest::ProcessAckedTouchEvent(
92 const WebKit::WebTouchEvent& touch, InputEventAckState ack_result) { 93 const WebKit::WebTouchEvent& touch, InputEventAckState ack_result) {
93 // TODO(fsamuel): Currently we will only take this codepath if the guest has 94 // TODO(fsamuel): Currently we will only take this codepath if the guest has
(...skipping 23 matching lines...) Expand all
117 118
118 void RenderWidgetHostViewGuest::Hide() { 119 void RenderWidgetHostViewGuest::Hide() {
119 WasHidden(); 120 WasHidden();
120 } 121 }
121 122
122 bool RenderWidgetHostViewGuest::IsShowing() { 123 bool RenderWidgetHostViewGuest::IsShowing() {
123 return !is_hidden_; 124 return !is_hidden_;
124 } 125 }
125 126
126 gfx::Rect RenderWidgetHostViewGuest::GetViewBounds() const { 127 gfx::Rect RenderWidgetHostViewGuest::GetViewBounds() const {
127 return platform_view_->GetViewBounds(); 128 return gfx::Rect(size_);
128 } 129 }
129 130
130 void RenderWidgetHostViewGuest::RenderViewGone(base::TerminationStatus status, 131 void RenderWidgetHostViewGuest::RenderViewGone(base::TerminationStatus status,
131 int error_code) { 132 int error_code) {
132 platform_view_->RenderViewGone(status, error_code); 133 platform_view_->RenderViewGone(status, error_code);
133 // Destroy the guest view instance only, so we don't end up calling 134 // Destroy the guest view instance only, so we don't end up calling
134 // platform_view_->Destroy(). 135 // platform_view_->Destroy().
135 DestroyGuestView(); 136 DestroyGuestView();
136 } 137 }
137 138
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 guest_->clear_damage_buffer(); 172 guest_->clear_damage_buffer();
172 guest_->SendMessageToEmbedder( 173 guest_->SendMessageToEmbedder(
173 new BrowserPluginMsg_CompositorFrameSwapped( 174 new BrowserPluginMsg_CompositorFrameSwapped(
174 guest_->instance_id(), 175 guest_->instance_id(),
175 *frame, 176 *frame,
176 host_->GetRoutingID(), 177 host_->GetRoutingID(),
177 host_->GetProcess()->GetID())); 178 host_->GetProcess()->GetID()));
178 } 179 }
179 180
180 void RenderWidgetHostViewGuest::SetBounds(const gfx::Rect& rect) { 181 void RenderWidgetHostViewGuest::SetBounds(const gfx::Rect& rect) {
181 platform_view_->SetBounds(rect); 182 SetSize(rect.size());
182 } 183 }
183 184
184 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) { 185 bool RenderWidgetHostViewGuest::OnMessageReceived(const IPC::Message& msg) {
185 return platform_view_->OnMessageReceived(msg); 186 return platform_view_->OnMessageReceived(msg);
186 } 187 }
187 188
188 void RenderWidgetHostViewGuest::InitAsChild( 189 void RenderWidgetHostViewGuest::InitAsChild(
189 gfx::NativeView parent_view) { 190 gfx::NativeView parent_view) {
190 platform_view_->InitAsChild(parent_view); 191 platform_view_->InitAsChild(parent_view);
191 } 192 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 return; 505 return;
505 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin(); 506 for (ui::GestureRecognizer::Gestures::iterator g_it = gestures->begin();
506 g_it != gestures->end(); 507 g_it != gestures->end();
507 ++g_it) { 508 ++g_it) {
508 ForwardGestureEventToRenderer(*g_it); 509 ForwardGestureEventToRenderer(*g_it);
509 } 510 }
510 } 511 }
511 512
512 513
513 } // namespace content 514 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_guest.h ('k') | content/browser/web_contents/web_contents_view_guest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698