OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/chromeos/accessibility/magnification_manager.h" | 5 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "ash/magnifier/magnification_controller.h" | 9 #include "ash/magnifier/magnification_controller.h" |
10 #include "ash/magnifier/partial_magnification_controller.h" | 10 #include "ash/magnifier/partial_magnification_controller.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 if (!enabled) { | 188 if (!enabled) { |
189 SetMagnifierEnabledInternal(enabled); | 189 SetMagnifierEnabledInternal(enabled); |
190 SetMagnifierTypeInternal(type); | 190 SetMagnifierTypeInternal(type); |
191 } else { | 191 } else { |
192 SetMagnifierTypeInternal(type); | 192 SetMagnifierTypeInternal(type); |
193 SetMagnifierEnabledInternal(enabled); | 193 SetMagnifierEnabledInternal(enabled); |
194 } | 194 } |
195 | 195 |
196 AccessibilityStatusEventDetails details( | 196 AccessibilityStatusEventDetails details( |
197 enabled_, type_, ash::A11Y_NOTIFICATION_NONE); | 197 ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, |
198 content::NotificationService::current()->Notify( | 198 enabled_, |
199 chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, | 199 type_, |
200 content::NotificationService::AllSources(), | 200 ash::A11Y_NOTIFICATION_NONE); |
201 content::Details<AccessibilityStatusEventDetails>(&details)); | |
202 | 201 |
203 #if defined(OS_CHROMEOS) | 202 #if defined(OS_CHROMEOS) |
204 if (ash::Shell::GetInstance() && AccessibilityManager::Get()) { | 203 if (AccessibilityManager::Get()) { |
205 ash::Shell::GetInstance()->SetCursorCompositingEnabled( | 204 AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details); |
206 AccessibilityManager::Get()->ShouldEnableCursorCompositing()); | 205 if (ash::Shell::GetInstance()) { |
| 206 ash::Shell::GetInstance()->SetCursorCompositingEnabled( |
| 207 AccessibilityManager::Get()->ShouldEnableCursorCompositing()); |
| 208 } |
207 } | 209 } |
208 #endif | 210 #endif |
209 } | 211 } |
210 | 212 |
211 // content::NotificationObserver implementation: | 213 // content::NotificationObserver implementation: |
212 virtual void Observe(int type, | 214 virtual void Observe(int type, |
213 const content::NotificationSource& source, | 215 const content::NotificationSource& source, |
214 const content::NotificationDetails& details) OVERRIDE { | 216 const content::NotificationDetails& details) OVERRIDE { |
215 switch (type) { | 217 switch (type) { |
216 case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: { | 218 case chrome::NOTIFICATION_LOGIN_OR_LOCK_WEBUI_VISIBLE: { |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 delete g_magnification_manager; | 270 delete g_magnification_manager; |
269 g_magnification_manager = NULL; | 271 g_magnification_manager = NULL; |
270 } | 272 } |
271 | 273 |
272 // static | 274 // static |
273 MagnificationManager* MagnificationManager::Get() { | 275 MagnificationManager* MagnificationManager::Get() { |
274 return g_magnification_manager; | 276 return g_magnification_manager; |
275 } | 277 } |
276 | 278 |
277 } // namespace chromeos | 279 } // namespace chromeos |
OLD | NEW |