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

Side by Side Diff: content/renderer/render_widget.cc

Issue 9609008: Implemented Browser Plugin (NOT FOR REVIEW) (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Initial plumbing of a guest flag to RenderViewImpl (cleaner than early prototype) 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
« no previous file with comments | « content/renderer/render_widget.h ('k') | example.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/renderer/render_widget.h" 5 #include "content/renderer/render_widget.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // when we receive ViewMsg_Close. 175 // when we receive ViewMsg_Close.
176 AddRef(); 176 AddRef();
177 } else { 177 } else {
178 DCHECK(false); 178 DCHECK(false);
179 } 179 }
180 } 180 }
181 181
182 // This is used to complete pending inits and non-pending inits. For non- 182 // This is used to complete pending inits and non-pending inits. For non-
183 // pending cases, the parent will be the same as the current parent. This 183 // pending cases, the parent will be the same as the current parent. This
184 // indicates we do not need to reparent or anything. 184 // indicates we do not need to reparent or anything.
185 void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd) { 185 void RenderWidget::CompleteInit(gfx::NativeViewId parent_hwnd, bool guest) {
186 DCHECK(routing_id_ != MSG_ROUTING_NONE); 186 DCHECK(routing_id_ != MSG_ROUTING_NONE);
187 187
188 host_window_ = parent_hwnd; 188 if (!guest) {
189 host_window_set_ = true; 189 host_window_ = parent_hwnd;
190 host_window_set_ = true;
190 191
191 DoDeferredUpdate(); 192 DoDeferredUpdate();
193 }
192 194
193 Send(new ViewHostMsg_RenderViewReady(routing_id_)); 195 Send(new ViewHostMsg_RenderViewReady(routing_id_));
194 } 196 }
195 197
196 void RenderWidget::SetSwappedOut(bool is_swapped_out) { 198 void RenderWidget::SetSwappedOut(bool is_swapped_out) {
197 // We should only toggle between states. 199 // We should only toggle between states.
198 DCHECK(is_swapped_out_ != is_swapped_out); 200 DCHECK(is_swapped_out_ != is_swapped_out);
199 is_swapped_out_ = is_swapped_out; 201 is_swapped_out_ = is_swapped_out;
200 202
201 // If we are swapping out, we will call ReleaseProcess, allowing the process 203 // If we are swapping out, we will call ReleaseProcess, allowing the process
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 // Balances the AddRef taken when we called AddRoute. 328 // Balances the AddRef taken when we called AddRoute.
327 Release(); 329 Release();
328 } 330 }
329 331
330 // Got a response from the browser after the renderer decided to create a new 332 // Got a response from the browser after the renderer decided to create a new
331 // view. 333 // view.
332 void RenderWidget::OnCreatingNewAck( 334 void RenderWidget::OnCreatingNewAck(
333 gfx::NativeViewId parent) { 335 gfx::NativeViewId parent) {
334 DCHECK(routing_id_ != MSG_ROUTING_NONE); 336 DCHECK(routing_id_ != MSG_ROUTING_NONE);
335 337
336 CompleteInit(parent); 338 CompleteInit(parent, false);
337 } 339 }
338 340
339 void RenderWidget::OnResize(const gfx::Size& new_size, 341 void RenderWidget::OnResize(const gfx::Size& new_size,
340 const gfx::Rect& resizer_rect, 342 const gfx::Rect& resizer_rect,
341 bool is_fullscreen) { 343 bool is_fullscreen) {
342 Resize(new_size, resizer_rect, is_fullscreen, SEND_RESIZE_ACK); 344 Resize(new_size, resizer_rect, is_fullscreen, SEND_RESIZE_ACK);
343 } 345 }
344 346
345 void RenderWidget::OnChangeResizeRect(const gfx::Rect& resizer_rect) { 347 void RenderWidget::OnChangeResizeRect(const gfx::Rect& resizer_rect) {
346 if (resizer_rect_ != resizer_rect) { 348 if (resizer_rect_ != resizer_rect) {
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after
1666 } 1668 }
1667 } 1669 }
1668 1670
1669 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { 1671 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) {
1670 return false; 1672 return false;
1671 } 1673 }
1672 1674
1673 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { 1675 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const {
1674 return false; 1676 return false;
1675 } 1677 }
OLDNEW
« no previous file with comments | « content/renderer/render_widget.h ('k') | example.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698