OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/cursor_renderer_aura.h" | 5 #include "content/browser/media/capture/cursor_renderer_aura.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void TearDown() override { | 57 void TearDown() override { |
58 cursor_renderer_.reset(); | 58 cursor_renderer_.reset(); |
59 window_.reset(); | 59 window_.reset(); |
60 AuraTestBase::TearDown(); | 60 AuraTestBase::TearDown(); |
61 } | 61 } |
62 | 62 |
63 void SetTickClock(base::SimpleTestTickClock* clock) { | 63 void SetTickClock(base::SimpleTestTickClock* clock) { |
64 cursor_renderer_->tick_clock_ = clock; | 64 cursor_renderer_->tick_clock_ = clock; |
65 } | 65 } |
66 | 66 |
67 base::TimeDelta Now() { | 67 base::TimeTicks Now() { return cursor_renderer_->tick_clock_->NowTicks(); } |
68 return cursor_renderer_->tick_clock_->NowTicks() - base::TimeTicks(); | |
69 } | |
70 | 68 |
71 bool CursorDisplayed() { return cursor_renderer_->cursor_displayed_; } | 69 bool CursorDisplayed() { return cursor_renderer_->cursor_displayed_; } |
72 | 70 |
73 void RenderCursorOnVideoFrame( | 71 void RenderCursorOnVideoFrame( |
74 const scoped_refptr<media::VideoFrame>& target) { | 72 const scoped_refptr<media::VideoFrame>& target) { |
75 cursor_renderer_->RenderOnVideoFrame(target); | 73 cursor_renderer_->RenderOnVideoFrame(target); |
76 } | 74 } |
77 | 75 |
78 void SnapshotCursorState(gfx::Rect region_in_frame) { | 76 void SnapshotCursorState(gfx::Rect region_in_frame) { |
79 cursor_renderer_->SnapshotCursorState(region_in_frame); | 77 cursor_renderer_->SnapshotCursorState(region_in_frame); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 | 237 |
240 // Cursor being displayed even if another window is activated. | 238 // Cursor being displayed even if another window is activated. |
241 std::unique_ptr<aura::Window> window2(aura::test::CreateTestWindowWithBounds( | 239 std::unique_ptr<aura::Window> window2(aura::test::CreateTestWindowWithBounds( |
242 gfx::Rect(0, 0, 800, 600), root_window())); | 240 gfx::Rect(0, 0, 800, 600), root_window())); |
243 wm::ActivateWindow(window2.get()); | 241 wm::ActivateWindow(window2.get()); |
244 SnapshotCursorState(gfx::Rect(0, 0, 800, 600)); | 242 SnapshotCursorState(gfx::Rect(0, 0, 800, 600)); |
245 EXPECT_TRUE(CursorDisplayed()); | 243 EXPECT_TRUE(CursorDisplayed()); |
246 } | 244 } |
247 | 245 |
248 } // namespace content | 246 } // namespace content |
OLD | NEW |