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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate_chromeos.cc

Issue 102483006: Getting rid of GetDefaultProfile & fixing multi user issues with accessibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unit test Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include "ash/accessibility_delegate.h" 7 #include "ash/accessibility_delegate.h"
8 #include "ash/media_delegate.h" 8 #include "ash/media_delegate.h"
9 #include "ash/wm/mru_window_tracker.h" 9 #include "ash/wm/mru_window_tracker.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 virtual void SetAutoclickEnabled(bool enabled) OVERRIDE { 111 virtual void SetAutoclickEnabled(bool enabled) OVERRIDE {
112 DCHECK(chromeos::AccessibilityManager::Get()); 112 DCHECK(chromeos::AccessibilityManager::Get());
113 return chromeos::AccessibilityManager::Get()->EnableAutoclick(enabled); 113 return chromeos::AccessibilityManager::Get()->EnableAutoclick(enabled);
114 } 114 }
115 115
116 virtual bool IsAutoclickEnabled() const OVERRIDE { 116 virtual bool IsAutoclickEnabled() const OVERRIDE {
117 DCHECK(chromeos::AccessibilityManager::Get()); 117 DCHECK(chromeos::AccessibilityManager::Get());
118 return chromeos::AccessibilityManager::Get()->IsAutoclickEnabled(); 118 return chromeos::AccessibilityManager::Get()->IsAutoclickEnabled();
119 } 119 }
120 120
121 virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE { 121 virtual bool ShouldShowAccessibilityMenu() const OVERRIDE {
122 Profile* profile = ProfileManager::GetActiveUserProfileOrOffTheRecord(); 122 DCHECK(chromeos::AccessibilityManager::Get());
123 if (!profile) 123 return chromeos::AccessibilityManager::Get()->
124 return false; 124 ShouldShowAccessibilityMenu();
125
126 PrefService* user_pref_service = profile->GetPrefs();
127 return user_pref_service && user_pref_service->GetBoolean(
128 prefs::kShouldAlwaysShowAccessibilityMenu);
129 } 125 }
130 126
131 virtual void SilenceSpokenFeedback() const OVERRIDE { 127 virtual void SilenceSpokenFeedback() const OVERRIDE {
132 TtsController::GetInstance()->Stop(); 128 TtsController::GetInstance()->Stop();
133 } 129 }
134 130
135 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE { 131 virtual void SaveScreenMagnifierScale(double scale) OVERRIDE {
136 if (chromeos::MagnificationManager::Get()) 132 if (chromeos::MagnificationManager::Get())
137 chromeos::MagnificationManager::Get()->SaveScreenMagnifierScale(scale); 133 chromeos::MagnificationManager::Get()->SaveScreenMagnifierScale(scale);
138 } 134 }
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 } 262 }
267 263
268 void ChromeShellDelegate::PlatformInit() { 264 void ChromeShellDelegate::PlatformInit() {
269 registrar_.Add(this, 265 registrar_.Add(this,
270 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 266 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
271 content::NotificationService::AllSources()); 267 content::NotificationService::AllSources());
272 registrar_.Add(this, 268 registrar_.Add(this,
273 chrome::NOTIFICATION_SESSION_STARTED, 269 chrome::NOTIFICATION_SESSION_STARTED,
274 content::NotificationService::AllSources()); 270 content::NotificationService::AllSources());
275 } 271 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698