OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/capture/aura_window_capture_machine.h" | 5 #include "content/browser/media/capture/aura_window_capture_machine.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/timer/timer.h" | 9 #include "base/timer/timer.h" |
10 #include "cc/output/copy_output_request.h" | 10 #include "cc/output/copy_output_request.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
449 aura::Window* window, | 449 aura::Window* window, |
450 const gfx::Rect& old_bounds, | 450 const gfx::Rect& old_bounds, |
451 const gfx::Rect& new_bounds) { | 451 const gfx::Rect& new_bounds) { |
452 DCHECK(desktop_window_ && window == desktop_window_); | 452 DCHECK(desktop_window_ && window == desktop_window_); |
453 | 453 |
454 // Post task to update capture size on UI thread. | 454 // Post task to update capture size on UI thread. |
455 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 455 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
456 &AuraWindowCaptureMachine::UpdateCaptureSize, AsWeakPtr())); | 456 &AuraWindowCaptureMachine::UpdateCaptureSize, AsWeakPtr())); |
457 } | 457 } |
458 | 458 |
459 void AuraWindowCaptureMachine::OnWindowDestroyed(aura::Window* window) { | 459 void AuraWindowCaptureMachine::OnWindowDestroying(aura::Window* window) { |
miu
2015/09/03 20:46:44
Note: I changed this from OnWindowDestroyed() to O
| |
460 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 460 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
461 | 461 |
462 Stop(base::Bind(&base::DoNothing)); | 462 InternalStop(base::Bind(&base::DoNothing)); |
463 | 463 |
464 oracle_proxy_->ReportError("OnWindowDestroyed()"); | 464 oracle_proxy_->ReportError("OnWindowDestroying()"); |
465 } | 465 } |
466 | 466 |
467 void AuraWindowCaptureMachine::OnWindowAddedToRootWindow( | 467 void AuraWindowCaptureMachine::OnWindowAddedToRootWindow( |
468 aura::Window* window) { | 468 aura::Window* window) { |
469 DCHECK(window == desktop_window_); | 469 DCHECK(window == desktop_window_); |
470 window->GetHost()->compositor()->AddObserver(this); | 470 window->GetHost()->compositor()->AddObserver(this); |
471 } | 471 } |
472 | 472 |
473 void AuraWindowCaptureMachine::OnWindowRemovingFromRootWindow( | 473 void AuraWindowCaptureMachine::OnWindowRemovingFromRootWindow( |
474 aura::Window* window, | 474 aura::Window* window, |
475 aura::Window* new_root) { | 475 aura::Window* new_root) { |
476 DCHECK(window == desktop_window_); | 476 DCHECK(window == desktop_window_); |
477 window->GetHost()->compositor()->RemoveObserver(this); | 477 window->GetHost()->compositor()->RemoveObserver(this); |
478 } | 478 } |
479 | 479 |
480 void AuraWindowCaptureMachine::OnCompositingEnded( | 480 void AuraWindowCaptureMachine::OnCompositingEnded( |
481 ui::Compositor* compositor) { | 481 ui::Compositor* compositor) { |
482 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). | 482 // TODO(miu): The CopyOutputRequest should be made earlier, at WillCommit(). |
483 // http://crbug.com/492839 | 483 // http://crbug.com/492839 |
484 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 484 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
485 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); | 485 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); |
486 } | 486 } |
487 | 487 |
488 } // namespace content | 488 } // namespace content |
OLD | NEW |