This source file includes following definitions.
- UpdatePlatformSpecificHistograms
#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include <windows.h>
#include <psapi.h>
#include "base/files/file_path.h"
#include "base/metrics/histogram.h"
#include "base/strings/string_util.h"
namespace content {
void BrowserAccessibilityStateImpl::UpdatePlatformSpecificHistograms() {
AUDIODESCRIPTION audio_description = {0};
audio_description.cbSize = sizeof(AUDIODESCRIPTION);
SystemParametersInfo(SPI_GETAUDIODESCRIPTION, 0, &audio_description, 0);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinAudioDescription",
!!audio_description.Enabled);
BOOL win_screen_reader = FALSE;
SystemParametersInfo(SPI_GETSCREENREADER, 0, &win_screen_reader, 0);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinScreenReader",
!!win_screen_reader);
STICKYKEYS sticky_keys = {0};
sticky_keys.cbSize = sizeof(STICKYKEYS);
SystemParametersInfo(SPI_GETSTICKYKEYS, 0, &sticky_keys, 0);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinStickyKeys",
0 != (sticky_keys.dwFlags & SKF_STICKYKEYSON));
HANDLE process = GetCurrentProcess();
HMODULE* modules = NULL;
DWORD bytes_required;
if (!EnumProcessModules(process, modules, 0, &bytes_required))
return;
scoped_ptr<char[]> buffer(new char[bytes_required]);
modules = reinterpret_cast<HMODULE*>(buffer.get());
DWORD ignore;
if (!EnumProcessModules(process, modules, bytes_required, &ignore))
return;
bool jaws = false;
bool nvda = false;
bool satogo = false;
bool zoomtext = false;
size_t module_count = bytes_required / sizeof(HMODULE);
for (size_t i = 0; i < module_count; i++) {
TCHAR filename[MAX_PATH];
GetModuleFileName(modules[i], filename, sizeof(filename));
base::string16 module_name(base::FilePath(filename).BaseName().value());
if (LowerCaseEqualsASCII(module_name, "fsdomsrv.dll"))
jaws = true;
if (LowerCaseEqualsASCII(module_name, "vbufbackend_gecko_ia2.dll"))
nvda = true;
if (LowerCaseEqualsASCII(module_name, "stsaw32.dll"))
satogo = true;
if (LowerCaseEqualsASCII(module_name, "zslhook.dll"))
zoomtext = true;
}
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinJAWS", jaws);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinNVDA", nvda);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinSAToGo", satogo);
UMA_HISTOGRAM_BOOLEAN("Accessibility.WinZoomText", zoomtext);
}
}