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

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

Issue 2493293002: RenderWidget: make routing_id be a parameter of the ctor (Closed)
Patch Set: Solve the unittest riddle. Created 4 years, 1 month 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 RenderWidgetFullscreenPepper* widget_; 245 RenderWidgetFullscreenPepper* widget_;
246 WebSize size_; 246 WebSize size_;
247 247
248 DISALLOW_COPY_AND_ASSIGN(PepperWidget); 248 DISALLOW_COPY_AND_ASSIGN(PepperWidget);
249 }; 249 };
250 250
251 } // anonymous namespace 251 } // anonymous namespace
252 252
253 // static 253 // static
254 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create( 254 RenderWidgetFullscreenPepper* RenderWidgetFullscreenPepper::Create(
255 int32_t routing_id,
255 int32_t opener_id, 256 int32_t opener_id,
256 CompositorDependencies* compositor_deps, 257 CompositorDependencies* compositor_deps,
257 PepperPluginInstanceImpl* plugin, 258 PepperPluginInstanceImpl* plugin,
258 const GURL& active_url, 259 const GURL& active_url,
259 const ScreenInfo& screen_info) { 260 const ScreenInfo& screen_info) {
261 DCHECK_NE(MSG_ROUTING_NONE, routing_id);
260 DCHECK_NE(MSG_ROUTING_NONE, opener_id); 262 DCHECK_NE(MSG_ROUTING_NONE, opener_id);
261 scoped_refptr<RenderWidgetFullscreenPepper> widget( 263 scoped_refptr<RenderWidgetFullscreenPepper> widget(
262 new RenderWidgetFullscreenPepper(compositor_deps, plugin, active_url, 264 new RenderWidgetFullscreenPepper(routing_id, compositor_deps, plugin,
263 screen_info)); 265 active_url, screen_info));
264 widget->Init(opener_id); 266 widget->Init(opener_id);
265 widget->AddRef(); 267 widget->AddRef();
266 return widget.get(); 268 return widget.get();
267 } 269 }
268 270
269 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper( 271 RenderWidgetFullscreenPepper::RenderWidgetFullscreenPepper(
272 int32_t routing_id,
270 CompositorDependencies* compositor_deps, 273 CompositorDependencies* compositor_deps,
271 PepperPluginInstanceImpl* plugin, 274 PepperPluginInstanceImpl* plugin,
272 const GURL& active_url, 275 const GURL& active_url,
273 const ScreenInfo& screen_info) 276 const ScreenInfo& screen_info)
274 : RenderWidgetFullscreen(compositor_deps, screen_info), 277 : RenderWidgetFullscreen(routing_id, compositor_deps, screen_info),
275 active_url_(active_url), 278 active_url_(active_url),
276 plugin_(plugin), 279 plugin_(plugin),
277 layer_(NULL), 280 layer_(NULL),
278 mouse_lock_dispatcher_(new FullscreenMouseLockDispatcher(this)) {} 281 mouse_lock_dispatcher_(new FullscreenMouseLockDispatcher(this)) {}
279 282
280 RenderWidgetFullscreenPepper::~RenderWidgetFullscreenPepper() { 283 RenderWidgetFullscreenPepper::~RenderWidgetFullscreenPepper() {
281 } 284 }
282 285
283 void RenderWidgetFullscreenPepper::Invalidate() { 286 void RenderWidgetFullscreenPepper::Invalidate() {
284 InvalidateRect(gfx::Rect(size_.width(), size_.height())); 287 InvalidateRect(gfx::Rect(size_.width(), size_.height()));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() { 374 GURL RenderWidgetFullscreenPepper::GetURLForGraphicsContext3D() {
372 return active_url_; 375 return active_url_;
373 } 376 }
374 377
375 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() { 378 void RenderWidgetFullscreenPepper::OnDeviceScaleFactorChanged() {
376 if (compositor_) 379 if (compositor_)
377 compositor_->setDeviceScaleFactor(device_scale_factor_); 380 compositor_->setDeviceScaleFactor(device_scale_factor_);
378 } 381 }
379 382
380 } // namespace content 383 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698