| OLD | NEW |
| 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 MediaSettingsRange_h | 5 #ifndef MediaSettingsRange_h |
| 6 #define MediaSettingsRange_h | 6 #define MediaSettingsRange_h |
| 7 | 7 |
| 8 #include "bindings/core/v8/ScriptWrappable.h" | 8 #include "bindings/core/v8/ScriptWrappable.h" |
| 9 #include "media/capture/mojo/image_capture.mojom-blink.h" | 9 #include "media/capture/mojo/image_capture.mojom-blink.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class MediaSettingsRange final : public GarbageCollected<MediaSettingsRange>, | 13 class MediaSettingsRange final : public GarbageCollected<MediaSettingsRange>, |
| 14 public ScriptWrappable { | 14 public ScriptWrappable { |
| 15 DEFINE_WRAPPERTYPEINFO(); | 15 DEFINE_WRAPPERTYPEINFO(); |
| 16 | 16 |
| 17 public: | 17 public: |
| 18 static MediaSettingsRange* create(double max, | 18 static MediaSettingsRange* create(double max, |
| 19 double min, | 19 double min, |
| 20 double current, | |
| 21 double step) { | 20 double step) { |
| 22 return new MediaSettingsRange(max, min, current, step); | 21 return new MediaSettingsRange(max, min, step); |
| 23 } | 22 } |
| 24 static MediaSettingsRange* create(media::mojom::blink::RangePtr range) { | 23 static MediaSettingsRange* create(media::mojom::blink::RangePtr range) { |
| 25 return MediaSettingsRange::create(*range); | 24 return MediaSettingsRange::create(*range); |
| 26 } | 25 } |
| 27 static MediaSettingsRange* create(const media::mojom::blink::Range& range) { | 26 static MediaSettingsRange* create(const media::mojom::blink::Range& range) { |
| 28 return MediaSettingsRange::create(range.max, range.min, range.current, | 27 return MediaSettingsRange::create(range.max, range.min, range.step); |
| 29 range.step); | |
| 30 } | 28 } |
| 31 | 29 |
| 32 double max() const { return m_max; } | 30 double max() const { return m_max; } |
| 33 double min() const { return m_min; } | 31 double min() const { return m_min; } |
| 34 double current() const { return m_current; } | |
| 35 double step() const { return m_step; } | 32 double step() const { return m_step; } |
| 36 | 33 |
| 37 DEFINE_INLINE_TRACE() {} | 34 DEFINE_INLINE_TRACE() {} |
| 38 | 35 |
| 39 private: | 36 private: |
| 40 MediaSettingsRange(double max, double min, double current, double step) | 37 MediaSettingsRange(double max, double min, double step) |
| 41 : m_max(max), m_min(min), m_current(current), m_step(step) {} | 38 : m_max(max), m_min(min), m_step(step) {} |
| 42 | 39 |
| 43 double m_max; | 40 double m_max; |
| 44 double m_min; | 41 double m_min; |
| 45 double m_current; | |
| 46 double m_step; | 42 double m_step; |
| 47 }; | 43 }; |
| 48 | 44 |
| 49 } // namespace blink | 45 } // namespace blink |
| 50 | 46 |
| 51 #endif // MediaSettingsRange_h | 47 #endif // MediaSettingsRange_h |
| OLD | NEW |