Index: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp |
diff --git a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp |
index 300a5a1e694976aad1c6b882fd1d09aa6531bfa3..8b463aae9b1e4979d974b736a45a334a42d14e97 100644 |
--- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp |
+++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp |
@@ -27,6 +27,8 @@ |
namespace blink { |
+using FillLightMode = media::mojom::blink::FillLightMode; |
+ |
namespace { |
const char kNoServiceError[] = "ImageCapture service unavailable."; |
@@ -47,16 +49,14 @@ media::mojom::blink::MeteringMode parseMeteringMode(const String& blinkMode) { |
return media::mojom::blink::MeteringMode::NONE; |
} |
-media::mojom::blink::FillLightMode parseFillLightMode(const String& blinkMode) { |
+FillLightMode parseFillLightMode(const String& blinkMode) { |
if (blinkMode == "off") |
- return media::mojom::blink::FillLightMode::OFF; |
+ return FillLightMode::OFF; |
if (blinkMode == "auto") |
- return media::mojom::blink::FillLightMode::AUTO; |
+ return FillLightMode::AUTO; |
if (blinkMode == "flash") |
- return media::mojom::blink::FillLightMode::FLASH; |
- if (blinkMode == "torch") |
- return media::mojom::blink::FillLightMode::TORCH; |
- return media::mojom::blink::FillLightMode::NONE; |
+ return FillLightMode::FLASH; |
+ return FillLightMode::NONE; |
} |
WebString toString(media::mojom::blink::MeteringMode value) { |
@@ -430,7 +430,16 @@ void ImageCapture::onPhotoCapabilities( |
MediaSettingsRange::create(std::move(capabilities->height))); |
caps->setImageWidth( |
MediaSettingsRange::create(std::move(capabilities->width))); |
- caps->setFillLightMode(capabilities->fill_light_mode); |
+ |
+ // TODO(mcasas): use a list of supported modes when mojo is updated. |
+ // https://crbug.com/700607. |
+ if (capabilities->fill_light_mode == FillLightMode::NONE) |
+ caps->setFillLightMode(Vector<FillLightMode>()); |
+ else |
+ caps->setFillLightMode({capabilities->fill_light_mode}); |
+ |
+ // TODO(mcasas): use a list of supported modes when mojo is updated. |
+ // https://crbug.com/700607. |
caps->setRedEyeReduction(capabilities->red_eye_reduction); |
resolver->resolve(caps); |