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 8cc231c69695b7d41826f72c8aeefb2223ee7625..926fa8222238a84a00d5f2ffcc6f21c323b52d46 100644 |
--- a/chrome/browser/chromeos/accessibility/accessibility_util.cc |
+++ b/chrome/browser/chromeos/accessibility/accessibility_util.cc |
@@ -22,15 +22,18 @@ |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_manager.h" |
#include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
+#include "chrome/browser/ui/singleton_tabs.h" |
#include "chrome/common/extensions/extension.h" |
#include "chrome/common/extensions/extension_messages.h" |
#include "chrome/common/extensions/extension_resource.h" |
#include "chrome/common/extensions/user_script.h" |
#include "chrome/common/pref_names.h" |
+#include "chrome/common/url_constants.h" |
#include "content/public/browser/render_process_host.h" |
#include "content/public/browser/render_view_host.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_ui.h" |
+#include "googleurl/src/gurl.h" |
#include "grit/browser_resources.h" |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util.h" |
@@ -193,17 +196,17 @@ void EnableHighContrast(bool enabled) { |
#endif |
} |
-void SetScreenMagnifier(ScreenMagnifierType type) { |
+void SetScreenMagnifier(ash::MagnifierType type) { |
PrefService* pref_service = g_browser_process->local_state(); |
- pref_service->SetString(prefs::kScreenMagnifierType, |
+ pref_service->SetString(prefs::kMagnifierType, |
ScreenMagnifierNameFromType(type)); |
pref_service->CommitPendingWrite(); |
#if defined(USE_ASH) |
ash::Shell::GetInstance()->magnification_controller()->SetEnabled( |
- type == MAGNIFIER_FULL); |
+ type == ash::MAGNIFIER_FULL); |
ash::Shell::GetInstance()->partial_magnification_controller()->SetEnabled( |
- type == MAGNIFIER_PARTIAL); |
+ type == ash::MAGNIFIER_PARTIAL); |
#endif |
} |
@@ -256,35 +259,35 @@ bool IsHighContrastEnabled() { |
return high_contrast_enabled; |
} |
-ScreenMagnifierType GetScreenMagnifierType() { |
+ash::MagnifierType GetMagnifierType() { |
if (!g_browser_process) |
- return MAGNIFIER_OFF; |
+ return ash::MAGNIFIER_OFF; |
PrefService* prefs = g_browser_process->local_state(); |
std::string screen_magnifier_type; |
if (!prefs) |
- return MAGNIFIER_OFF; |
+ return ash::MAGNIFIER_OFF; |
- return ScreenMagnifierTypeFromName( |
- prefs->GetString(prefs::kScreenMagnifierType).c_str()); |
+ return MagnifierTypeFromName( |
+ prefs->GetString(prefs::kMagnifierType).c_str()); |
} |
-ScreenMagnifierType ScreenMagnifierTypeFromName(const char type_name[]) { |
+ash::MagnifierType MagnifierTypeFromName(const char type_name[]) { |
if (0 == strcmp(type_name, kScreenMagnifierFull)) |
- return MAGNIFIER_FULL; |
+ return ash::MAGNIFIER_FULL; |
else if (0 == strcmp(type_name, kScreenMagnifierPartial)) |
- return MAGNIFIER_PARTIAL; |
+ return ash::MAGNIFIER_PARTIAL; |
else |
- return MAGNIFIER_OFF; |
+ return ash::MAGNIFIER_OFF; |
} |
-const char* ScreenMagnifierNameFromType(ScreenMagnifierType type) { |
+const char* ScreenMagnifierNameFromType(ash::MagnifierType type) { |
switch (type) { |
- case MAGNIFIER_OFF: |
+ case ash::MAGNIFIER_OFF: |
return kScreenMagnifierOff; |
- case MAGNIFIER_FULL: |
+ case ash::MAGNIFIER_FULL: |
return kScreenMagnifierFull; |
- case MAGNIFIER_PARTIAL: |
+ case ash::MAGNIFIER_PARTIAL: |
return kScreenMagnifierPartial; |
} |
return kScreenMagnifierOff; |
@@ -295,5 +298,9 @@ void MaybeSpeak(const std::string& utterance) { |
Speak(utterance); |
} |
+void ShowAccessibilityHelp(Browser* browser) { |
+ chrome::ShowSingletonTab(browser, GURL(chrome::kChromeAccessibilityHelpURL)); |
+} |
+ |
} // namespace accessibility |
} // namespace chromeos |