OLD | NEW |
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/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 } | 326 } |
327 | 327 |
328 void RenderWidgetHostViewAura::Blur() { | 328 void RenderWidgetHostViewAura::Blur() { |
329 window_->Blur(); | 329 window_->Blur(); |
330 } | 330 } |
331 | 331 |
332 bool RenderWidgetHostViewAura::HasFocus() const { | 332 bool RenderWidgetHostViewAura::HasFocus() const { |
333 return window_->HasFocus(); | 333 return window_->HasFocus(); |
334 } | 334 } |
335 | 335 |
| 336 bool RenderWidgetHostViewAura::IsSurfaceAvailableForCopy() const { |
| 337 return current_surface_ != 0; |
| 338 } |
| 339 |
336 void RenderWidgetHostViewAura::Show() { | 340 void RenderWidgetHostViewAura::Show() { |
337 window_->Show(); | 341 window_->Show(); |
338 } | 342 } |
339 | 343 |
340 void RenderWidgetHostViewAura::Hide() { | 344 void RenderWidgetHostViewAura::Hide() { |
341 window_->Hide(); | 345 window_->Hide(); |
342 } | 346 } |
343 | 347 |
344 bool RenderWidgetHostViewAura::IsShowing() { | 348 bool RenderWidgetHostViewAura::IsShowing() { |
345 return window_->IsVisible(); | 349 return window_->IsVisible(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 | 446 |
443 void RenderWidgetHostViewAura::CopyFromCompositingSurface( | 447 void RenderWidgetHostViewAura::CopyFromCompositingSurface( |
444 const gfx::Size& size, | 448 const gfx::Size& size, |
445 skia::PlatformCanvas* output, | 449 skia::PlatformCanvas* output, |
446 base::Callback<void(bool)> callback) { | 450 base::Callback<void(bool)> callback) { |
447 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); | 451 base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); |
448 ui::Compositor* compositor = GetCompositor(); | 452 ui::Compositor* compositor = GetCompositor(); |
449 if (!compositor) | 453 if (!compositor) |
450 return; | 454 return; |
451 | 455 |
452 ImageTransportClient* container = image_transport_clients_[current_surface_]; | 456 std::map<uint64, scoped_refptr<ImageTransportClient> >::iterator it = |
453 if (!container) | 457 image_transport_clients_.find(current_surface_); |
| 458 if (it == image_transport_clients_.end()) |
454 return; | 459 return; |
455 | 460 |
| 461 ImageTransportClient* container = it->second; |
| 462 DCHECK(container); |
| 463 |
456 gfx::Size size_in_pixel = content::ConvertSizeToPixel(this, size); | 464 gfx::Size size_in_pixel = content::ConvertSizeToPixel(this, size); |
457 if (!output->initialize( | 465 if (!output->initialize( |
458 size_in_pixel.width(), size_in_pixel.height(), true)) | 466 size_in_pixel.width(), size_in_pixel.height(), true)) |
459 return; | 467 return; |
460 | 468 |
461 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); | 469 ImageTransportFactory* factory = ImageTransportFactory::GetInstance(); |
462 content::GLHelper* gl_helper = factory->GetGLHelper(compositor); | 470 content::GLHelper* gl_helper = factory->GetGLHelper(compositor); |
463 if (!gl_helper) | 471 if (!gl_helper) |
464 return; | 472 return; |
465 | 473 |
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( | 1335 RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget( |
1328 RenderWidgetHost* widget) { | 1336 RenderWidgetHost* widget) { |
1329 return new RenderWidgetHostViewAura(widget); | 1337 return new RenderWidgetHostViewAura(widget); |
1330 } | 1338 } |
1331 | 1339 |
1332 // static | 1340 // static |
1333 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( | 1341 void content::RenderWidgetHostViewPort::GetDefaultScreenInfo( |
1334 WebKit::WebScreenInfo* results) { | 1342 WebKit::WebScreenInfo* results) { |
1335 GetScreenInfoForWindow(results, NULL); | 1343 GetScreenInfoForWindow(results, NULL); |
1336 } | 1344 } |
OLD | NEW |