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

Unified Diff: third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp

Issue 2785503003: Image Capture: update PhotoCapabilities.idl to latest Spec changes (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
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);

Powered by Google App Engine
This is Rietveld 408576698