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

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

Issue 1245863003: Initialize CompositorDependencies in RenderWidget's constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/renderer/render_widget_fullscreen_pepper.h" 5 #include "content/renderer/render_widget_fullscreen_pepper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 263
264 // static 264 // static
265 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( 265 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create(
266 int32 opener_id, 266 int32 opener_id,
267 CompositorDependencies* compositor_deps, 267 CompositorDependencies* compositor_deps,
268 PepperPluginInstanceImpl* plugin, 268 PepperPluginInstanceImpl* plugin,
269 const GURL& active_url, 269 const GURL& active_url,
270 const blink::WebScreenInfo& screen_info) { 270 const blink::WebScreenInfo& screen_info) {
271 DCHECK_NE(MSG_ROUTING_NONE, opener_id); 271 DCHECK_NE(MSG_ROUTING_NONE, opener_id);
272 scoped_refptr<RenderWidgetFullscreenPepper> widget( 272 scoped_refptr<RenderWidgetFullscreenPepper> widget(
273 new RenderWidgetFullscreenPepper(plugin, active_url, screen_info)); 273 new RenderWidgetFullscreenPepper(compositor_deps, plugin, active_url,
274 widget->Init(opener_id, compositor_deps); 274 screen_info));
275 widget->Init(opener_id);
275 widget->AddRef(); 276 widget->AddRef();
276 return widget.get(); 277 return widget.get();
277 } 278 }
278 279
279 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper( 280 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper(
281 CompositorDependencies* compositor_deps,
280 PepperPluginInstanceImpl* plugin, 282 PepperPluginInstanceImpl* plugin,
281 const GURL& active_url, 283 const GURL& active_url,
282 const blink::WebScreenInfo& screen_info) 284 const blink::WebScreenInfo& screen_info)
283 : RenderWidgetFullscreen(screen_info), 285 : RenderWidgetFullscreen(compositor_deps, screen_info),
284 active_url_(active_url), 286 active_url_(active_url),
285 plugin_(plugin), 287 plugin_(plugin),
286 layer_(NULL), 288 layer_(NULL),
287 mouse_lock_dispatcher_(new FullscreenMouseLockDispatcher( 289 mouse_lock_dispatcher_(new FullscreenMouseLockDispatcher(this)) {}
288 this)) {
289 }
290 290
291 RenderWidgetFullscreenPepper::~RenderWidgetFullscreenPepper() { 291 RenderWidgetFullscreenPepper::~RenderWidgetFullscreenPepper() {
292 } 292 }
293 293
294 void RenderWidgetFullscreenPepper::Invalidate() { 294 void RenderWidgetFullscreenPepper::Invalidate() {
295 InvalidateRect(gfx::Rect(size_.width(), size_.height())); 295 InvalidateRect(gfx::Rect(size_.width(), size_.height()));
296 } 296 }
297 297
298 void RenderWidgetFullscreenPepper::InvalidateRect(const blink::WebRect& rect) { 298 void RenderWidgetFullscreenPepper::InvalidateRect(const blink::WebRect& rect) {
299 didInvalidateRect(rect); 299 didInvalidateRect(rect);
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 } 388 }
389 389
390 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor( 390 void RenderWidgetFullscreenPepper::SetDeviceScaleFactor(
391 float device_scale_factor) { 391 float device_scale_factor) {
392 RenderWidget::SetDeviceScaleFactor(device_scale_factor); 392 RenderWidget::SetDeviceScaleFactor(device_scale_factor);
393 if (compositor_) 393 if (compositor_)
394 compositor_->setDeviceScaleFactor(device_scale_factor); 394 compositor_->setDeviceScaleFactor(device_scale_factor);
395 } 395 }
396 396
397 } // namespace content 397 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698