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

Unified Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 11280236: A11y: Add the option to always show the a11y tray menu regardless of the state of a11y features (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years 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/ui/ash/chrome_shell_delegate.cc
diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
index 3bede4b9e3e584a8d6241628cc10382365978d3a..7e3e3211dca0e962e531acde646c8b309625f45c 100644
--- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
+++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
@@ -100,7 +100,7 @@ ChromeShellDelegate::~ChromeShellDelegate() {
instance_ = NULL;
}
-bool ChromeShellDelegate::IsUserLoggedIn() {
+bool ChromeShellDelegate::IsUserLoggedIn() const {
#if defined(OS_CHROMEOS)
// When running a Chrome OS build outside of a device (i.e. on a developer's
// workstation) and not running as login-manager, pretend like we're always
@@ -117,7 +117,7 @@ bool ChromeShellDelegate::IsUserLoggedIn() {
}
// Returns true if we're logged in and browser has been started
-bool ChromeShellDelegate::IsSessionStarted() {
+bool ChromeShellDelegate::IsSessionStarted() const {
#if defined(OS_CHROMEOS)
return chromeos::UserManager::Get()->IsSessionStarted();
#else
@@ -125,7 +125,7 @@ bool ChromeShellDelegate::IsSessionStarted() {
#endif
}
-bool ChromeShellDelegate::IsFirstRunAfterBoot() {
+bool ChromeShellDelegate::IsFirstRunAfterBoot() const {
#if defined(OS_CHROMEOS)
return CommandLine::ForCurrentProcess()->HasSwitch(switches::kFirstBoot);
#else
@@ -133,7 +133,7 @@ bool ChromeShellDelegate::IsFirstRunAfterBoot() {
#endif
}
-bool ChromeShellDelegate::CanLockScreen() {
+bool ChromeShellDelegate::CanLockScreen() const {
#if defined(OS_CHROMEOS)
return chromeos::UserManager::Get()->CanCurrentUserLock();
#else
@@ -372,8 +372,16 @@ void ChromeShellDelegate::SetMagnifier(ash::MagnifierType type) {
bool ChromeShellDelegate::ShouldAlwaysShowAccessibilityMenu() const {
#if defined(OS_CHROMEOS)
- // TODO(yoshiki): Add the checkbox on chrome://settings. crbug.com/158287
- return false;
+ if (!IsUserLoggedIn())
+ return true;
+
+ Profile* profile = ProfileManager::GetDefaultProfile();
+ if (!profile)
+ return false;
+
+ PrefService* user_pref_service = profile->GetPrefs();
+ return user_pref_service &&
+ user_pref_service->GetBoolean(prefs::kShouldAlwaysShowAccessibilityMenu);
#else
return false;
#endif
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/webui/options/browser_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698