| 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 "content/browser/accessibility/browser_accessibility_state_impl.h" | 5 #include "content/browser/accessibility/browser_accessibility_state_impl.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 #include <psapi.h> | 8 #include <psapi.h> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 #include "base/macros.h" |
| 11 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 12 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 | 16 |
| 16 void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { | 17 void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() { |
| 17 // NOTE: this method is run from the file thread to reduce jank, since | 18 // NOTE: this method is run from the file thread to reduce jank, since |
| 18 // there's no guarantee these system calls will return quickly. Be careful | 19 // there's no guarantee these system calls will return quickly. Be careful |
| 19 // not to add any code that isn't safe to run from a non-main thread! | 20 // not to add any code that isn't safe to run from a non-main thread! |
| 20 | 21 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 49 return; | 50 return; |
| 50 | 51 |
| 51 // Look for DLLs of assistive technology known to work with Chrome. | 52 // Look for DLLs of assistive technology known to work with Chrome. |
| 52 bool jaws = false; | 53 bool jaws = false; |
| 53 bool nvda = false; | 54 bool nvda = false; |
| 54 bool satogo = false; | 55 bool satogo = false; |
| 55 bool zoomtext = false; | 56 bool zoomtext = false; |
| 56 size_t module_count = bytes_required / sizeof(HMODULE); | 57 size_t module_count = bytes_required / sizeof(HMODULE); |
| 57 for (size_t i = 0; i < module_count; i++) { | 58 for (size_t i = 0; i < module_count; i++) { |
| 58 TCHAR filename[MAX_PATH]; | 59 TCHAR filename[MAX_PATH]; |
| 59 GetModuleFileName(modules[i], filename, sizeof(filename)); | 60 GetModuleFileName(modules[i], filename, arraysize(filename)); |
| 60 base::string16 module_name(base::FilePath(filename).BaseName().value()); | 61 base::string16 module_name(base::FilePath(filename).BaseName().value()); |
| 61 if (LowerCaseEqualsASCII(module_name, "fsdomsrv.dll")) | 62 if (LowerCaseEqualsASCII(module_name, "fsdomsrv.dll")) |
| 62 jaws = true; | 63 jaws = true; |
| 63 if (LowerCaseEqualsASCII(module_name, "vbufbackend_gecko_ia2.dll")) | 64 if (LowerCaseEqualsASCII(module_name, "vbufbackend_gecko_ia2.dll")) |
| 64 nvda = true; | 65 nvda = true; |
| 65 if (LowerCaseEqualsASCII(module_name, "stsaw32.dll")) | 66 if (LowerCaseEqualsASCII(module_name, "stsaw32.dll")) |
| 66 satogo = true; | 67 satogo = true; |
| 67 if (LowerCaseEqualsASCII(module_name, "zslhook.dll")) | 68 if (LowerCaseEqualsASCII(module_name, "zslhook.dll")) |
| 68 zoomtext = true; | 69 zoomtext = true; |
| 69 } | 70 } |
| 70 | 71 |
| 71 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinJAWS", jaws); | 72 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinJAWS", jaws); |
| 72 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinNVDA", nvda); | 73 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinNVDA", nvda); |
| 73 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinSAToGo", satogo); | 74 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinSAToGo", satogo); |
| 74 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinZoomText", zoomtext); | 75 UMA_HISTOGRAM_BOOLEAN("Accessibility.WinZoomText", zoomtext); |
| 75 } | 76 } |
| 76 | 77 |
| 77 } // namespace content | 78 } // namespace content |
| OLD | NEW |