| 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 #include "modules/imagecapture/ImageCapture.h" | 5 #include "modules/imagecapture/ImageCapture.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" | 7 #include "bindings/core/v8/CallbackPromiseAdapter.h" |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/ExceptionCode.h" | 10 #include "core/dom/ExceptionCode.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 DVLOG(1) << __FUNCTION__; | 193 DVLOG(1) << __FUNCTION__; |
| 194 if (!m_serviceRequests.contains(resolver)) | 194 if (!m_serviceRequests.contains(resolver)) |
| 195 return; | 195 return; |
| 196 if (capabilities.is_null()) { | 196 if (capabilities.is_null()) { |
| 197 resolver->reject(DOMException::create(UnknownError, "platform error")); | 197 resolver->reject(DOMException::create(UnknownError, "platform error")); |
| 198 } else { | 198 } else { |
| 199 // TODO(mcasas): Should be using a mojo::StructTraits. | 199 // TODO(mcasas): Should be using a mojo::StructTraits. |
| 200 MediaSettingsRange* zoom = MediaSettingsRange::create(capabilities->zoom
->max, capabilities->zoom->min, capabilities->zoom->current); | 200 MediaSettingsRange* zoom = MediaSettingsRange::create(capabilities->zoom
->max, capabilities->zoom->min, capabilities->zoom->current); |
| 201 PhotoCapabilities* caps = PhotoCapabilities::create(); | 201 PhotoCapabilities* caps = PhotoCapabilities::create(); |
| 202 caps->setZoom(zoom); | 202 caps->setZoom(zoom); |
| 203 caps->setFocusMode(capabilities->focus_mode); |
| 203 resolver->resolve(caps); | 204 resolver->resolve(caps); |
| 204 } | 205 } |
| 205 m_serviceRequests.remove(resolver); | 206 m_serviceRequests.remove(resolver); |
| 206 } | 207 } |
| 207 | 208 |
| 208 void ImageCapture::onSetOptions(ScriptPromiseResolver* resolver, bool result) | 209 void ImageCapture::onSetOptions(ScriptPromiseResolver* resolver, bool result) |
| 209 { | 210 { |
| 210 if (!m_serviceRequests.contains(resolver)) | 211 if (!m_serviceRequests.contains(resolver)) |
| 211 return; | 212 return; |
| 212 | 213 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 241 | 242 |
| 242 DEFINE_TRACE(ImageCapture) | 243 DEFINE_TRACE(ImageCapture) |
| 243 { | 244 { |
| 244 visitor->trace(m_streamTrack); | 245 visitor->trace(m_streamTrack); |
| 245 visitor->trace(m_serviceRequests); | 246 visitor->trace(m_serviceRequests); |
| 246 EventTargetWithInlineData::trace(visitor); | 247 EventTargetWithInlineData::trace(visitor); |
| 247 ContextLifecycleObserver::trace(visitor); | 248 ContextLifecycleObserver::trace(visitor); |
| 248 } | 249 } |
| 249 | 250 |
| 250 } // namespace blink | 251 } // namespace blink |
| OLD | NEW |