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

Side by Side Diff: content/browser/media/capture/cursor_renderer_mac.h

Issue 2553763002: Fix cursor missing in tabCapture on OSX Sierra (Closed)
Patch Set: implement CursorRenderer Created 3 years, 12 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_ 5 #ifndef CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_
6 #define CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_ 6 #define CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_
7 7
8 #include "base/mac/scoped_cftyperef.h"
9 #include "base/macros.h"
10 #include "base/memory/weak_ptr.h"
11 #include "content/browser/media/capture/cursor_renderer.h" 8 #include "content/browser/media/capture/cursor_renderer.h"
12 #include "content/common/content_export.h"
13 #include "media/base/video_frame.h"
14 9
15 namespace content { 10 namespace content {
16 11
17 // Tracks state for making decisions on cursor display on a captured video 12 // Tracks state for making decisions on cursor display on a captured video
miu 2016/12/27 23:21:03 ditto: Class comment needs updating. (or just remo
braveyao 2017/01/04 01:57:49 Done.
18 // frame. 13 // frame.
19 class CONTENT_EXPORT CursorRendererMac : public CursorRenderer { 14 class CONTENT_EXPORT CursorRendererMac : public CursorRenderer {
20 public: 15 public:
21 explicit CursorRendererMac(NSView* view); 16 explicit CursorRendererMac(gfx::NativeView view);
22 ~CursorRendererMac() final; 17 ~CursorRendererMac() final;
23 18
24 // CursorRender implementation. 19 // CursorRender implementation.
25 void Clear() final; 20 bool IsCapturedViewActive() final;
26 bool SnapshotCursorState(const gfx::Rect& region_in_frame) final; 21 gfx::Size GetCapturedViewSize() final;
27 void RenderOnVideoFrame( 22 gfx::Point GetCursorPositionInView() final;
28 const scoped_refptr<media::VideoFrame>& target) const final; 23 gfx::NativeCursor GetLastKnownCursor() final;
29 base::WeakPtr<CursorRenderer> GetWeakPtr() final; 24 gfx::Point GetLastKnownCursorHotPoint() final;
25 SkBitmap GetLastKnownCursorImage() final;
30 26
31 private: 27 private:
32 NSView* const view_; 28 NSView* const view_;
33 base::ScopedCFTypeRef<CFDataRef> last_cursor_data_; 29 gfx::Point last_known_cursor_location_;
34 int last_cursor_width_;
35 int last_cursor_height_;
36 gfx::Point cursor_position_in_frame_;
37 30
38 base::TimeTicks last_mouse_movement_timestamp_;
39 float last_mouse_location_x_;
40 float last_mouse_location_y_;
41
42 base::WeakPtrFactory<CursorRendererMac> weak_factory_;
43 DISALLOW_COPY_AND_ASSIGN(CursorRendererMac); 31 DISALLOW_COPY_AND_ASSIGN(CursorRendererMac);
44 }; 32 };
45 33
46 } // namespace content 34 } // namespace content
47 35
48 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_ 36 #endif // CONTENT_BROWSER_MEDIA_CAPTURE_CURSOR_RENDERER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698