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

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

Issue 14200048: Introduce AcccessibilityManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 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/keyboard_overlay/keyboard_overlay_view.h" 7 #include "ash/keyboard_overlay/keyboard_overlay_view.h"
8 #include "ash/system/chromeos/network/network_observer.h" 8 #include "ash/system/chromeos/network/network_observer.h"
9 #include "ash/system/tray/system_tray_notifier.h" 9 #include "ash/system/tray/system_tray_notifier.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/utf_string_conversions.h" 13 #include "base/utf_string_conversions.h"
14 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" 14 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" 15 #include "chrome/browser/chromeos/accessibility/magnification_manager.h"
16 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h" 16 #include "chrome/browser/chromeos/background/ash_user_wallpaper_delegate.h"
17 #include "chrome/browser/chromeos/cros/cros_library.h" 17 #include "chrome/browser/chromeos/cros/cros_library.h"
18 #include "chrome/browser/chromeos/cros/network_library.h" 18 #include "chrome/browser/chromeos/cros/network_library.h"
19 #include "chrome/browser/chromeos/display/display_preferences.h" 19 #include "chrome/browser/chromeos/display/display_preferences.h"
20 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h" 20 #include "chrome/browser/chromeos/extensions/file_manager/file_manager_util.h"
21 #include "chrome/browser/chromeos/extensions/media_player_api.h" 21 #include "chrome/browser/chromeos/extensions/media_player_api.h"
22 #include "chrome/browser/chromeos/extensions/media_player_event_router.h" 22 #include "chrome/browser/chromeos/extensions/media_player_event_router.h"
23 #include "chrome/browser/chromeos/input_method/input_method_configuration.h" 23 #include "chrome/browser/chromeos/input_method/input_method_configuration.h"
24 #include "chrome/browser/chromeos/input_method/input_method_manager.h" 24 #include "chrome/browser/chromeos/input_method/input_method_manager.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 l10n_util::GetStringUTF16(IDS_NETWORK_ACTIVATION_ERROR_TITLE), 115 l10n_util::GetStringUTF16(IDS_NETWORK_ACTIVATION_ERROR_TITLE),
116 l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION, 116 l10n_util::GetStringFUTF16(IDS_NETWORK_ACTIVATION_NEEDS_CONNECTION,
117 UTF8ToUTF16((cellular->name()))), 117 UTF8ToUTF16((cellular->name()))),
118 std::vector<string16>()); 118 std::vector<string16>());
119 return; 119 return;
120 } 120 }
121 MobileSetupDialog::Show(service_path); 121 MobileSetupDialog::Show(service_path);
122 } 122 }
123 123
124 void ChromeShellDelegate::ToggleHighContrast() { 124 void ChromeShellDelegate::ToggleHighContrast() {
125 bool enabled = chromeos::accessibility::IsHighContrastEnabled(); 125 bool enabled = chromeos::AccessibilityManager::Get()->IsHighContrastEnabled();
126 chromeos::accessibility::EnableHighContrast(!enabled); 126 chromeos::AccessibilityManager::Get()->EnableHighContrast(!enabled);
127 } 127 }
128 128
129 bool ChromeShellDelegate::IsSpokenFeedbackEnabled() const { 129 bool ChromeShellDelegate::IsSpokenFeedbackEnabled() const {
130 return chromeos::accessibility::IsSpokenFeedbackEnabled(); 130 return chromeos::AccessibilityManager::Get()->IsSpokenFeedbackEnabled();
131 } 131 }
132 132
133 void ChromeShellDelegate::ToggleSpokenFeedback( 133 void ChromeShellDelegate::ToggleSpokenFeedback(
134 ash::AccessibilityNotificationVisibility notify) { 134 ash::AccessibilityNotificationVisibility notify) {
135 content::WebUI* web_ui = NULL; 135 content::WebUI* web_ui = NULL;
136 136
137 chromeos::LoginDisplayHostImpl* host = 137 chromeos::LoginDisplayHostImpl* host =
138 static_cast<chromeos::LoginDisplayHostImpl*>( 138 static_cast<chromeos::LoginDisplayHostImpl*>(
139 chromeos::LoginDisplayHostImpl::default_host()); 139 chromeos::LoginDisplayHostImpl::default_host());
140 if (host && host->GetOobeUI()) 140 if (host && host->GetOobeUI())
141 web_ui = host->GetOobeUI()->web_ui(); 141 web_ui = host->GetOobeUI()->web_ui();
142 142
143 if (!web_ui && 143 if (!web_ui &&
144 chromeos::ScreenLocker::default_screen_locker() && 144 chromeos::ScreenLocker::default_screen_locker() &&
145 chromeos::ScreenLocker::default_screen_locker()->locked()) { 145 chromeos::ScreenLocker::default_screen_locker()->locked()) {
146 web_ui = chromeos::ScreenLocker::default_screen_locker()-> 146 web_ui = chromeos::ScreenLocker::default_screen_locker()->
147 GetAssociatedWebUI(); 147 GetAssociatedWebUI();
148 } 148 }
149 chromeos::accessibility::ToggleSpokenFeedback(web_ui, notify); 149 chromeos::AccessibilityManager::Get()->ToggleSpokenFeedback(web_ui, notify);
150 } 150 }
151 151
152 bool ChromeShellDelegate::IsHighContrastEnabled() const { 152 bool ChromeShellDelegate::IsHighContrastEnabled() const {
153 return chromeos::accessibility::IsHighContrastEnabled(); 153 return chromeos::AccessibilityManager::Get()->IsHighContrastEnabled();
154 } 154 }
155 155
156 bool ChromeShellDelegate::IsMagnifierEnabled() const { 156 bool ChromeShellDelegate::IsMagnifierEnabled() const {
157 DCHECK(chromeos::MagnificationManager::Get()); 157 DCHECK(chromeos::MagnificationManager::Get());
158 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled(); 158 return chromeos::MagnificationManager::Get()->IsMagnifierEnabled();
159 } 159 }
160 160
161 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const { 161 ash::MagnifierType ChromeShellDelegate::GetMagnifierType() const {
162 DCHECK(chromeos::MagnificationManager::Get()); 162 DCHECK(chromeos::MagnificationManager::Get());
163 return chromeos::MagnificationManager::Get()->GetMagnifierType(); 163 return chromeos::MagnificationManager::Get()->GetMagnifierType();
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 } 253 }
254 254
255 void ChromeShellDelegate::PlatformInit() { 255 void ChromeShellDelegate::PlatformInit() {
256 registrar_.Add(this, 256 registrar_.Add(this,
257 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, 257 chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED,
258 content::NotificationService::AllSources()); 258 content::NotificationService::AllSources());
259 registrar_.Add(this, 259 registrar_.Add(this,
260 chrome::NOTIFICATION_SESSION_STARTED, 260 chrome::NOTIFICATION_SESSION_STARTED,
261 content::NotificationService::AllSources()); 261 content::NotificationService::AllSources());
262 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698