| 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 "camera_facing_chromeos.h" | 5 #include "camera_facing_chromeos.h" |
| 6 | 6 |
| 7 #include <base/files/file_util.h> | 7 #include <base/files/file_util.h> |
| 8 #include <base/logging.h> | 8 #include <base/logging.h> |
| 9 #include <base/strings/stringprintf.h> | 9 #include <base/strings/stringprintf.h> |
| 10 #include <base/strings/string_number_conversions.h> | 10 #include <base/strings/string_number_conversions.h> |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 break; | 163 break; |
| 164 default: | 164 default: |
| 165 DLOG(ERROR) << "Invalid value for lens_facing: " << lens_facing; | 165 DLOG(ERROR) << "Invalid value for lens_facing: " << lens_facing; |
| 166 continue; | 166 continue; |
| 167 } | 167 } |
| 168 } else if (sub_keys.size() == 3 && sub_keys[2] == kUsbVidPid) { | 168 } else if (sub_keys.size() == 3 && sub_keys[2] == kUsbVidPid) { |
| 169 if (value.empty()) { | 169 if (value.empty()) { |
| 170 DLOG(ERROR) << "model_id is empty"; | 170 DLOG(ERROR) << "model_id is empty"; |
| 171 continue; | 171 continue; |
| 172 } | 172 } |
| 173 model_id_to_camera_id_[value.as_string()] = camera_id; | 173 std::string model_id = value.as_string(); |
| 174 std::transform(model_id.begin(), model_id.end(), model_id.begin(), |
| 175 ::tolower); |
| 176 model_id_to_camera_id_[model_id] = camera_id; |
| 174 } else if (sub_keys.size() == 3 && sub_keys[2] == kUsbPath) { | 177 } else if (sub_keys.size() == 3 && sub_keys[2] == kUsbPath) { |
| 175 if (value.empty()) { | 178 if (value.empty()) { |
| 176 DLOG(ERROR) << "usb_path is empty"; | 179 DLOG(ERROR) << "usb_path is empty"; |
| 177 continue; | 180 continue; |
| 178 } | 181 } |
| 179 usb_id_to_camera_id_[value.as_string()] = camera_id; | 182 usb_id_to_camera_id_[value.as_string()] = camera_id; |
| 180 } | 183 } |
| 181 // Ignore unknown or unutilized attributes. | 184 // Ignore unknown or unutilized attributes. |
| 182 } | 185 } |
| 183 } | 186 } |
| 184 | 187 |
| 185 } // namespace media | 188 } // namespace media |
| OLD | NEW |