Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_util.cc

Issue 11414232: Add Chrome OS accessibility histograms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/accessibility/accessibility_util.cc
diff --git a/chrome/browser/chromeos/accessibility/accessibility_util.cc b/chrome/browser/chromeos/accessibility/accessibility_util.cc
index 2340e75a223f961cced1a70624e30f2ecf9abe06..ca58c196fddec08fe687d51621adc060c50b0448 100644
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc
@@ -13,6 +13,7 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/logging.h"
+#include "base/metrics/histogram.h"
#include "chrome/browser/accessibility/accessibility_extension_api.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h"
@@ -28,6 +29,7 @@
#include "chrome/common/extensions/extension_resource.h"
#include "chrome/common/extensions/user_script.h"
#include "chrome/common/pref_names.h"
+#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -108,6 +110,23 @@ class ContentScriptLoader {
std::queue<ExtensionResource> resources_;
};
+void UpdateChromeOSAccessibilityHistograms() {
+ UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosSpokenFeedback",
Nikita (slow) 2012/11/29 18:29:23 Should you also report histograms if users enable/
+ IsSpokenFeedbackEnabled());
+ UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosHighContrast",
+ IsHighContrastEnabled());
+ UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosVirtualKeyboard",
+ IsVirtualKeyboardEnabled());
+ UMA_HISTOGRAM_ENUMERATION("Accessibility.CrosScreenMagnifier",
+ GetScreenMagnifierType(),
+ 3);
+}
+
+void Initialize() {
+ content::BrowserAccessibilityState::GetInstance()->AddHistogramCallback(
+ base::Bind(&UpdateChromeOSAccessibilityHistograms));
+}
+
void EnableSpokenFeedback(bool enabled, content::WebUI* login_web_ui) {
bool spoken_feedback_enabled = g_browser_process &&
g_browser_process->local_state()->GetBoolean(
@@ -245,6 +264,16 @@ bool IsHighContrastEnabled() {
return high_contrast_enabled;
}
+bool IsVirtualKeyboardEnabled() {
+ if (!g_browser_process) {
+ return false;
+ }
+ PrefService* prefs = g_browser_process->local_state();
+ bool virtual_keyboard_enabled = prefs &&
+ prefs->GetBoolean(prefs::kVirtualKeyboardEnabled);
+ return virtual_keyboard_enabled;
+}
+
ScreenMagnifierType GetScreenMagnifierType() {
if (!MagnificationManager::GetInstance())
return MAGNIFIER_OFF;
« no previous file with comments | « chrome/browser/chromeos/accessibility/accessibility_util.h ('k') | chrome/browser/chromeos/chrome_browser_main_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698