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

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

Issue 11821053: Revert 176087 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months 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
===================================================================
--- chrome/browser/chromeos/accessibility/accessibility_util.cc (revision 176100)
+++ chrome/browser/chromeos/accessibility/accessibility_util.cc (working copy)
@@ -50,6 +50,10 @@
namespace chromeos {
namespace accessibility {
+const char kScreenMagnifierOff[] = "";
+const char kScreenMagnifierFull[] = "full";
+const char kScreenMagnifierPartial[] = "partial";
+
// Helper class that directly loads an extension's content scripts into
// all of the frames corresponding to a given RenderViewHost.
class ContentScriptLoader {
@@ -119,14 +123,10 @@
IsHighContrastEnabled());
UMA_HISTOGRAM_BOOLEAN("Accessibility.CrosVirtualKeyboard",
IsVirtualKeyboardEnabled());
- if (MagnificationManager::Get()) {
- uint32 type = MagnificationManager::Get()->IsMagnifierEnabled() ?
- MagnificationManager::Get()->GetMagnifierType() : 0;
- // '0' means magnifier is disabled.
+ if (MagnificationManager::Get())
UMA_HISTOGRAM_ENUMERATION("Accessibility.CrosScreenMagnifier",
- type,
- ash::kMaxMagnifierType + 1);
- }
+ MagnificationManager::Get()->GetMagnifierType(),
+ 3);
}
void Initialize() {
@@ -290,6 +290,27 @@
return virtual_keyboard_enabled;
}
+ash::MagnifierType MagnifierTypeFromName(const char type_name[]) {
+ if (0 == strcmp(type_name, kScreenMagnifierFull))
+ return ash::MAGNIFIER_FULL;
+ else if (0 == strcmp(type_name, kScreenMagnifierPartial))
+ return ash::MAGNIFIER_PARTIAL;
+ else
+ return ash::MAGNIFIER_OFF;
+}
+
+const char* ScreenMagnifierNameFromType(ash::MagnifierType type) {
+ switch (type) {
+ case ash::MAGNIFIER_OFF:
+ return kScreenMagnifierOff;
+ case ash::MAGNIFIER_FULL:
+ return kScreenMagnifierFull;
+ case ash::MAGNIFIER_PARTIAL:
+ return kScreenMagnifierPartial;
+ }
+ return kScreenMagnifierOff;
+}
+
void MaybeSpeak(const std::string& utterance) {
if (IsSpokenFeedbackEnabled())
Speak(utterance);

Powered by Google App Engine
This is Rietveld 408576698