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 3// found in the LICENSE file. 4 5#include "chrome/browser/chromeos/accessibility/accessibility_util.h" 6 7#include "base/prefs/pref_service.h" 8#include "chrome/browser/browser_process.h" 9#include "chrome/browser/ui/singleton_tabs.h" 10#include "chrome/common/pref_names.h" 11#include "chrome/common/url_constants.h" 12#include "url/gurl.h" 13 14// TODO(yoshiki): move the following method to accessibility_manager.cc and 15// remove this file. 16 17namespace chromeos { 18namespace accessibility { 19 20void EnableVirtualKeyboard(bool enabled) { 21 PrefService* pref_service = g_browser_process->local_state(); 22 pref_service->SetBoolean(prefs::kAccessibilityVirtualKeyboardEnabled, 23 enabled); 24 pref_service->CommitPendingWrite(); 25} 26 27bool IsVirtualKeyboardEnabled() { 28 if (!g_browser_process) { 29 return false; 30 } 31 PrefService* prefs = g_browser_process->local_state(); 32 bool virtual_keyboard_enabled = 33 prefs && prefs->GetBoolean(prefs::kAccessibilityVirtualKeyboardEnabled); 34 return virtual_keyboard_enabled; 35} 36 37void ShowAccessibilityHelp(Browser* browser) { 38 chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); 39} 40 41} // namespace accessibility 42} // namespace chromeos 43