#include "content/browser/accessibility/browser_accessibility_state_impl.h"
#include "base/debug/crash_logging.h"
namespace content {
class BrowserAccessibilityStateImplChromeOS
: public BrowserAccessibilityStateImpl {
public:
BrowserAccessibilityStateImplChromeOS() = default;
protected:
void RefreshAssistiveTech() override {
bool is_active = GetAccessibilityMode().has_mode(ui::AXMode::kScreenReader);
static auto* ax_chromevox_crash_key = base::debug::AllocateCrashKeyString(
"ax_chromevox", base::debug::CrashKeySize::Size32);
if (is_active) {
base::debug::SetCrashKeyString(ax_chromevox_crash_key, "true");
} else {
base::debug::ClearCrashKeyString(ax_chromevox_crash_key);
}
OnAssistiveTechFound(is_active ? ui::AssistiveTech::kChromeVox
: ui::AssistiveTech::kNone);
}
};
std::unique_ptr<BrowserAccessibilityStateImpl>
BrowserAccessibilityStateImpl::Create() {
return std::make_unique<BrowserAccessibilityStateImplChromeOS>();
}
}