Chromium Code Reviews| 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, | 20 double current, |
| 21 double step) { | 21 double step) { |
| 22 return new MediaSettingsRange(max, min, current, step); | 22 return new MediaSettingsRange(max, min, current, step); |
| 23 } | 23 } |
| 24 static MediaSettingsRange* create(media::mojom::blink::RangePtr range) { | 24 static MediaSettingsRange* create(media::mojom::blink::RangePtr range) { |
| 25 return MediaSettingsRange::create(range->max, range->min, range->current, | 25 return MediaSettingsRange::create(range->max, range->min, range->current, |
|
Reilly Grant (use Gerrit)
2017/04/04 00:48:45
return MediaSettingsRange::create(*range);
(The .
mcasas
2017/04/04 01:42:38
Done.
| |
| 26 range->step); | 26 range->step); |
| 27 } | 27 } |
| 28 static MediaSettingsRange* create(const media::mojom::blink::Range& range) { | |
| 29 return MediaSettingsRange::create(range.max, range.min, range.current, | |
| 30 range.step); | |
| 31 } | |
| 28 | 32 |
| 29 double max() const { return m_max; } | 33 double max() const { return m_max; } |
| 30 double min() const { return m_min; } | 34 double min() const { return m_min; } |
| 31 double current() const { return m_current; } | 35 double current() const { return m_current; } |
| 32 double step() const { return m_step; } | 36 double step() const { return m_step; } |
| 33 | 37 |
| 34 DEFINE_INLINE_TRACE() {} | 38 DEFINE_INLINE_TRACE() {} |
| 35 | 39 |
| 36 private: | 40 private: |
| 37 MediaSettingsRange(double max, double min, double current, double step) | 41 MediaSettingsRange(double max, double min, double current, double step) |
| 38 : m_max(max), m_min(min), m_current(current), m_step(step) {} | 42 : m_max(max), m_min(min), m_current(current), m_step(step) {} |
| 39 | 43 |
| 40 double m_max; | 44 double m_max; |
| 41 double m_min; | 45 double m_min; |
| 42 double m_current; | 46 double m_current; |
| 43 double m_step; | 47 double m_step; |
| 44 }; | 48 }; |
| 45 | 49 |
| 46 } // namespace blink | 50 } // namespace blink |
| 47 | 51 |
| 48 #endif // MediaSettingsRange_h | 52 #endif // MediaSettingsRange_h |
| OLD | NEW |