Commit eae816a2 authored by dmazzoni@google.com's avatar dmazzoni@google.com

Revert 170590

It looks like the call to GetMagnifierType() on accessibility_util:124 is
introducing some crashes.

chrome!chromeos::accessibility::GetMagnifierType()
[accessibility_util.cc : 283 + 0xb

> Add Chrome OS accessibility histograms.
> 
> BUG=99504
> TBR=joi
> 
> Review URL: https://chromiumcodereview.appspot.com/11414232

TBR=dmazzoni@chromium.org
Review URL: https://codereview.chromium.org/11348342

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170698 0039d316-1c4b-4281-b951-d872f2087c98
parent d68b9a12
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/logging.h" #include "base/logging.h"
#include "base/metrics/histogram.h"
#include "chrome/browser/accessibility/accessibility_extension_api.h" #include "chrome/browser/accessibility/accessibility_extension_api.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h" #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
...@@ -32,7 +31,6 @@ ...@@ -32,7 +31,6 @@
#include "chrome/common/extensions/user_script.h" #include "chrome/common/extensions/user_script.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h" #include "chrome/common/url_constants.h"
#include "content/public/browser/browser_accessibility_state.h"
#include "content/public/browser/render_process_host.h" #include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h" #include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -114,23 +112,6 @@ class ContentScriptLoader { ...@@ -114,23 +112,6 @@ class ContentScriptLoader {
std::queue<ExtensionResource> resources_; std::queue<ExtensionResource> resources_;
}; };
void UpdateChromeOSAccessibilityHistograms() {
UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosSpokenFeedback",
IsSpokenFeedbackEnabled());
UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosHighContrast",
IsHighContrastEnabled());
UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosVirtualKeyboard",
IsVirtualKeyboardEnabled());
UMA_HISTOGRAM_ENUMERATION("Accessibility.CrosScreenMagnifier",
GetMagnifierType(),
3);
}
void Initialize() {
content::BrowserAccessibilityState::GetInstance()->AddHistogramCallback(
base::Bind(&UpdateChromeOSAccessibilityHistograms));
}
void EnableSpokenFeedback(bool enabled, content::WebUI* login_web_ui) { void EnableSpokenFeedback(bool enabled, content::WebUI* login_web_ui) {
bool spoken_feedback_enabled = g_browser_process && bool spoken_feedback_enabled = g_browser_process &&
g_browser_process->local_state()->GetBoolean( g_browser_process->local_state()->GetBoolean(
...@@ -267,16 +248,6 @@ bool IsHighContrastEnabled() { ...@@ -267,16 +248,6 @@ bool IsHighContrastEnabled() {
return high_contrast_enabled; 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;
}
ash::MagnifierType GetMagnifierType() { ash::MagnifierType GetMagnifierType() {
if (!MagnificationManager::GetInstance()) if (!MagnificationManager::GetInstance())
return ash::MAGNIFIER_OFF; return ash::MAGNIFIER_OFF;
......
...@@ -18,9 +18,6 @@ class WebUI; ...@@ -18,9 +18,6 @@ class WebUI;
namespace chromeos { namespace chromeos {
namespace accessibility { namespace accessibility {
// Do any accessibility initialization that should happen once on startup.
void Initialize();
// Enables or disables spoken feedback. Enabling spoken feedback installs the // Enables or disables spoken feedback. Enabling spoken feedback installs the
// ChromeVox component extension. If this is being called in a login/oobe // ChromeVox component extension. If this is being called in a login/oobe
// login screen, pass the WebUI object in login_web_ui so that ChromeVox // login screen, pass the WebUI object in login_web_ui so that ChromeVox
...@@ -49,9 +46,6 @@ bool IsSpokenFeedbackEnabled(); ...@@ -49,9 +46,6 @@ bool IsSpokenFeedbackEnabled();
// Returns true if High Contrast is enabled, or false if not. // Returns true if High Contrast is enabled, or false if not.
bool IsHighContrastEnabled(); bool IsHighContrastEnabled();
// Returns true if the Virtual Keyboard is enabled, or false if not.
bool IsVirtualKeyboardEnabled();
// Returns the current state of the screen magnifier. // Returns the current state of the screen magnifier.
ash::MagnifierType GetMagnifierType(); ash::MagnifierType GetMagnifierType();
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "base/string_number_conversions.h" #include "base/string_number_conversions.h"
#include "base/string_split.h" #include "base/string_split.h"
#include "chrome/browser/browser_process.h" #include "chrome/browser/browser_process.h"
#include "chrome/browser/chromeos/accessibility/accessibility_util.h"
#include "chrome/browser/chromeos/accessibility/magnification_manager.h" #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
#include "chrome/browser/chromeos/audio/audio_handler.h" #include "chrome/browser/chromeos/audio/audio_handler.h"
#include "chrome/browser/chromeos/boot_times_loader.h" #include "chrome/browser/chromeos/boot_times_loader.h"
...@@ -529,7 +528,6 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() { ...@@ -529,7 +528,6 @@ void ChromeBrowserMainPartsChromeos::PostProfileInit() {
} }
magnification_manager_.reset( magnification_manager_.reset(
chromeos::MagnificationManager::CreateInstance()); chromeos::MagnificationManager::CreateInstance());
chromeos::accessibility::Initialize();
primary_display_switch_observer_.reset( primary_display_switch_observer_.reset(
new PrimaryDisplaySwitchObserver()); new PrimaryDisplaySwitchObserver());
......
...@@ -80,17 +80,9 @@ bool BrowserAccessibilityStateImpl::IsAccessibleBrowser() { ...@@ -80,17 +80,9 @@ bool BrowserAccessibilityStateImpl::IsAccessibleBrowser() {
return (accessibility_mode_ == AccessibilityModeComplete); return (accessibility_mode_ == AccessibilityModeComplete);
} }
void BrowserAccessibilityStateImpl::AddHistogramCallback(
base::Closure callback) {
histogram_callbacks_.push_back(callback);
}
void BrowserAccessibilityStateImpl::UpdateHistogram() { void BrowserAccessibilityStateImpl::UpdateHistogram() {
UpdatePlatformSpecificHistograms(); UpdatePlatformSpecificHistograms();
for (size_t i = 0; i < histogram_callbacks_.size(); ++i)
histogram_callbacks_[i].Run();
UMA_HISTOGRAM_BOOLEAN("Accessibility.State", IsAccessibleBrowser()); UMA_HISTOGRAM_BOOLEAN("Accessibility.State", IsAccessibleBrowser());
UMA_HISTOGRAM_BOOLEAN("Accessibility.InvertedColors", UMA_HISTOGRAM_BOOLEAN("Accessibility.InvertedColors",
gfx::IsInvertedColorScheme()); gfx::IsInvertedColorScheme());
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_
#define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_ #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_STATE_IMPL_H_
#include <vector>
#include "base/basictypes.h" #include "base/basictypes.h"
#include "base/compiler_specific.h" #include "base/compiler_specific.h"
#include "base/memory/singleton.h" #include "base/memory/singleton.h"
...@@ -43,7 +41,6 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl ...@@ -43,7 +41,6 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl
virtual void OnAccessibilityEnabledManually() OVERRIDE; virtual void OnAccessibilityEnabledManually() OVERRIDE;
virtual void OnScreenReaderDetected() OVERRIDE; virtual void OnScreenReaderDetected() OVERRIDE;
virtual bool IsAccessibleBrowser() OVERRIDE; virtual bool IsAccessibleBrowser() OVERRIDE;
virtual void AddHistogramCallback(base::Closure callback) OVERRIDE;
// Called a short while after startup to allow time for the accessibility // Called a short while after startup to allow time for the accessibility
// state to be determined. Updates a histogram with the current state. // state to be determined. Updates a histogram with the current state.
...@@ -63,8 +60,6 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl ...@@ -63,8 +60,6 @@ class CONTENT_EXPORT BrowserAccessibilityStateImpl
AccessibilityMode accessibility_mode_; AccessibilityMode accessibility_mode_;
std::vector<base::Closure> histogram_callbacks_;
DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl); DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityStateImpl);
}; };
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#ifndef CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_ #ifndef CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_
#define CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_ #define CONTENT_PUBLIC_BROWSER_BROWSER_ACCESSIBILITY_STATE_H_
#include "base/callback_forward.h"
#include "content/common/content_export.h" #include "content/common/content_export.h"
namespace content { namespace content {
...@@ -28,12 +27,6 @@ class CONTENT_EXPORT BrowserAccessibilityState { ...@@ -28,12 +27,6 @@ class CONTENT_EXPORT BrowserAccessibilityState {
// Returns true if the browser should be customized for accessibility. // Returns true if the browser should be customized for accessibility.
virtual bool IsAccessibleBrowser() = 0; virtual bool IsAccessibleBrowser() = 0;
// Add a callback method that will be called once, a small while after the
// browser starts up, when accessibility state histograms are updated.
// Use this to register a method to update additional accessibility
// histograms.
virtual void AddHistogramCallback(base::Closure callback) = 0;
}; };
} // namespace content } // namespace content
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment