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

Side by Side Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.h

Issue 2865563002: Image Capture: teach takePhoto() to accept an optional PhotoSettings dictionary (Closed)
Patch Set: Created 3 years, 7 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 ImageCapture_h 5 #ifndef ImageCapture_h
6 #define ImageCapture_h 6 #define ImageCapture_h
7 7
8 #include <memory> 8 #include <memory>
9 #include "bindings/core/v8/ScriptPromise.h" 9 #include "bindings/core/v8/ScriptPromise.h"
10 #include "core/dom/ContextLifecycleObserver.h" 10 #include "core/dom/ContextLifecycleObserver.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // ScriptWrappable implementation. 49 // ScriptWrappable implementation.
50 bool HasPendingActivity() const final; 50 bool HasPendingActivity() const final;
51 51
52 // ContextLifecycleObserver 52 // ContextLifecycleObserver
53 void ContextDestroyed(ExecutionContext*) override; 53 void ContextDestroyed(ExecutionContext*) override;
54 54
55 MediaStreamTrack* videoStreamTrack() const { return stream_track_.Get(); } 55 MediaStreamTrack* videoStreamTrack() const { return stream_track_.Get(); }
56 56
57 ScriptPromise getPhotoCapabilities(ScriptState*); 57 ScriptPromise getPhotoCapabilities(ScriptState*);
58 58
59 ScriptPromise setOptions(ScriptState*, const PhotoSettings&); 59 ScriptPromise setOptions(ScriptState*, const PhotoSettings&, bool = false);
Reilly Grant (use Gerrit) 2017/05/05 16:00:28 Since the type name "bool" does not describe the a
mcasas 2017/05/05 16:38:07 Done.
60 60
61 ScriptPromise takePhoto(ScriptState*); 61 ScriptPromise takePhoto(ScriptState*);
62 ScriptPromise takePhoto(ScriptState*, const PhotoSettings&);
62 63
63 ScriptPromise grabFrame(ScriptState*); 64 ScriptPromise grabFrame(ScriptState*);
64 65
65 MediaTrackCapabilities& GetMediaTrackCapabilities(); 66 MediaTrackCapabilities& GetMediaTrackCapabilities();
66 void SetMediaTrackConstraints(ScriptPromiseResolver*, 67 void SetMediaTrackConstraints(ScriptPromiseResolver*,
67 const HeapVector<MediaTrackConstraintSet>&); 68 const HeapVector<MediaTrackConstraintSet>&);
68 const MediaTrackConstraintSet& GetMediaTrackConstraints() const; 69 const MediaTrackConstraintSet& GetMediaTrackConstraints() const;
69 void ClearMediaTrackConstraints(ScriptPromiseResolver*); 70 void ClearMediaTrackConstraints(ScriptPromiseResolver*);
70 void GetMediaTrackSettings(MediaTrackSettings&) const; 71 void GetMediaTrackSettings(MediaTrackSettings&) const;
71 72
72 // TODO(mcasas): Remove this service method, https://crbug.com/338503. 73 // TODO(mcasas): Remove this service method, https://crbug.com/338503.
73 bool HasNonImageCaptureConstraints(const MediaTrackConstraints&) const; 74 bool HasNonImageCaptureConstraints(const MediaTrackConstraints&) const;
74 75
75 DECLARE_VIRTUAL_TRACE(); 76 DECLARE_VIRTUAL_TRACE();
76 77
77 private: 78 private:
78 ImageCapture(ExecutionContext*, MediaStreamTrack*); 79 ImageCapture(ExecutionContext*, MediaStreamTrack*);
79 80
80 void OnPhotoCapabilities(ScriptPromiseResolver*, 81 void OnMojoPhotoCapabilities(ScriptPromiseResolver*,
81 media::mojom::blink::PhotoCapabilitiesPtr); 82 bool,
82 void OnSetOptions(ScriptPromiseResolver*, bool); 83 media::mojom::blink::PhotoCapabilitiesPtr);
83 void OnTakePhoto(ScriptPromiseResolver*, media::mojom::blink::BlobPtr); 84 void OnMojoSetOptions(ScriptPromiseResolver*, bool, bool);
Reilly Grant (use Gerrit) 2017/05/05 16:00:28 Please add variable names for these bools as well.
mcasas 2017/05/05 16:38:07 Done.
84 void OnCapabilitiesUpdate(media::mojom::blink::PhotoCapabilitiesPtr); 85 void OnMojoTakePhoto(ScriptPromiseResolver*, media::mojom::blink::BlobPtr);
85 86
86 void OnCapabilitiesUpdateInternal( 87 void UpdateMediaTrackCapabilities(media::mojom::blink::PhotoCapabilitiesPtr);
87 const media::mojom::blink::PhotoCapabilities&);
88 void OnServiceConnectionError(); 88 void OnServiceConnectionError();
89 89
90 Member<MediaStreamTrack> stream_track_; 90 Member<MediaStreamTrack> stream_track_;
91 std::unique_ptr<WebImageCaptureFrameGrabber> frame_grabber_; 91 std::unique_ptr<WebImageCaptureFrameGrabber> frame_grabber_;
92 media::mojom::blink::ImageCapturePtr service_; 92 media::mojom::blink::ImageCapturePtr service_;
93 93
94 MediaTrackCapabilities capabilities_; 94 MediaTrackCapabilities capabilities_;
95 MediaTrackSettings settings_; 95 MediaTrackSettings settings_;
96 MediaTrackConstraintSet current_constraints_; 96 MediaTrackConstraintSet current_constraints_;
97 97
98 HeapHashSet<Member<ScriptPromiseResolver>> service_requests_; 98 HeapHashSet<Member<ScriptPromiseResolver>> service_requests_;
99 }; 99 };
100 100
101 } // namespace blink 101 } // namespace blink
102 102
103 #endif // ImageCapture_h 103 #endif // ImageCapture_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698