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

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

Issue 2839053002: Image Capture: don't set PhotoCapabilities width/height if min/max are both zero (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58a274f5ad3f3b070ef55754df2a5a55186b3831..083e5955c86a1d71a6d73569ee885e239cba9431 100644
--- a/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
+++ b/third_party/WebKit/Source/modules/imagecapture/ImageCapture.cpp
@@ -496,10 +496,14 @@ void ImageCapture::OnPhotoCapabilities(
// TODO(mcasas): Remove the explicit MediaSettingsRange::create() when
// mojo::StructTraits supports garbage-collected mappings,
// https://crbug.com/700180.
- caps->SetImageHeight(
- MediaSettingsRange::Create(std::move(capabilities->height)));
- caps->SetImageWidth(
- MediaSettingsRange::Create(std::move(capabilities->width)));
+ if (capabilities->height->min != 0 || capabilities->height->max != 0) {
+ caps->SetImageHeight(
+ MediaSettingsRange::Create(std::move(capabilities->height)));
+ }
+ if (capabilities->width->min != 0 || capabilities->width->max != 0) {
+ caps->SetImageWidth(
+ MediaSettingsRange::Create(std::move(capabilities->width)));
+ }
caps->SetFillLightMode(capabilities->fill_light_mode);
resolver->Resolve(caps);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698