| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/config/gpu_info_collector.h" | 5 #include "gpu/config/gpu_info_collector.h" |
| 6 | 6 |
| 7 // This has to be included before windows.h. | 7 // This has to be included before windows.h. |
| 8 #include "third_party/re2/re2/re2.h" | 8 #include "third_party/re2/re2/re2.h" |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 namespace { | 44 namespace { |
| 45 | 45 |
| 46 // This must be kept in sync with histograms.xml. | 46 // This must be kept in sync with histograms.xml. |
| 47 enum DisplayLinkInstallationStatus { | 47 enum DisplayLinkInstallationStatus { |
| 48 DISPLAY_LINK_NOT_INSTALLED, | 48 DISPLAY_LINK_NOT_INSTALLED, |
| 49 DISPLAY_LINK_7_1_OR_EARLIER, | 49 DISPLAY_LINK_7_1_OR_EARLIER, |
| 50 DISPLAY_LINK_7_2_OR_LATER, | 50 DISPLAY_LINK_7_2_OR_LATER, |
| 51 DISPLAY_LINK_INSTALLATION_STATUS_MAX | 51 DISPLAY_LINK_INSTALLATION_STATUS_MAX |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 float ReadXMLFloatValue(XmlReader* reader) { | |
| 55 std::string score_string; | |
| 56 if (!reader->ReadElementContent(&score_string)) | |
| 57 return 0.0; | |
| 58 | |
| 59 double score; | |
| 60 if (!base::StringToDouble(score_string, &score)) | |
| 61 return 0.0; | |
| 62 | |
| 63 return static_cast<float>(score); | |
| 64 } | |
| 65 | |
| 66 // Returns the display link driver version or an invalid version if it is | 54 // Returns the display link driver version or an invalid version if it is |
| 67 // not installed. | 55 // not installed. |
| 68 Version DisplayLinkVersion() { | 56 Version DisplayLinkVersion() { |
| 69 base::win::RegKey key; | 57 base::win::RegKey key; |
| 70 | 58 |
| 71 if (key.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY)) | 59 if (key.Open(HKEY_LOCAL_MACHINE, L"SOFTWARE", KEY_READ | KEY_WOW64_64KEY)) |
| 72 return Version(); | 60 return Version(); |
| 73 | 61 |
| 74 if (key.OpenKey(L"DisplayLink", KEY_READ | KEY_WOW64_64KEY)) | 62 if (key.OpenKey(L"DisplayLink", KEY_READ | KEY_WOW64_64KEY)) |
| 75 return Version(); | 63 return Version(); |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 } | 493 } |
| 506 | 494 |
| 507 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); | 495 MergeGPUInfoGL(basic_gpu_info, context_gpu_info); |
| 508 | 496 |
| 509 basic_gpu_info->dx_diagnostics_info_state = | 497 basic_gpu_info->dx_diagnostics_info_state = |
| 510 context_gpu_info.dx_diagnostics_info_state; | 498 context_gpu_info.dx_diagnostics_info_state; |
| 511 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; | 499 basic_gpu_info->dx_diagnostics = context_gpu_info.dx_diagnostics; |
| 512 } | 500 } |
| 513 | 501 |
| 514 } // namespace gpu | 502 } // namespace gpu |
| OLD | NEW |