| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 SetMagnifierTypeInternal(type); | 197 SetMagnifierTypeInternal(type); |
| 198 SetMagnifierEnabledInternal(enabled); | 198 SetMagnifierEnabledInternal(enabled); |
| 199 } | 199 } |
| 200 | 200 |
| 201 AccessibilityStatusEventDetails details( | 201 AccessibilityStatusEventDetails details( |
| 202 ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, | 202 ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER, |
| 203 enabled_, | 203 enabled_, |
| 204 type_, | 204 type_, |
| 205 ui::A11Y_NOTIFICATION_NONE); | 205 ui::A11Y_NOTIFICATION_NONE); |
| 206 | 206 |
| 207 #if defined(OS_CHROMEOS) | |
| 208 if (AccessibilityManager::Get()) { | 207 if (AccessibilityManager::Get()) { |
| 209 AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details); | 208 AccessibilityManager::Get()->NotifyAccessibilityStatusChanged(details); |
| 210 if (ash::Shell::GetInstance()) { | 209 if (ash::Shell::GetInstance()) { |
| 211 ash::Shell::GetInstance()->SetCursorCompositingEnabled( | 210 ash::Shell::GetInstance()->SetCursorCompositingEnabled( |
| 212 AccessibilityManager::Get()->ShouldEnableCursorCompositing()); | 211 AccessibilityManager::Get()->ShouldEnableCursorCompositing()); |
| 213 } | 212 } |
| 214 } | 213 } |
| 215 #endif | |
| 216 } | 214 } |
| 217 | 215 |
| 218 void MonitorFocusInPageChange() { | 216 void MonitorFocusInPageChange() { |
| 219 if (enabled_ && !observing_focus_change_in_page_) { | 217 if (enabled_ && !observing_focus_change_in_page_) { |
| 220 registrar_.Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 218 registrar_.Add(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 221 content::NotificationService::AllSources()); | 219 content::NotificationService::AllSources()); |
| 222 observing_focus_change_in_page_ = true; | 220 observing_focus_change_in_page_ = true; |
| 223 } else if (!enabled_ && observing_focus_change_in_page_) { | 221 } else if (!enabled_ && observing_focus_change_in_page_) { |
| 224 registrar_.Remove(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, | 222 registrar_.Remove(this, content::NOTIFICATION_FOCUS_CHANGED_IN_PAGE, |
| 225 content::NotificationService::AllSources()); | 223 content::NotificationService::AllSources()); |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 296 delete g_magnification_manager; | 294 delete g_magnification_manager; |
| 297 g_magnification_manager = NULL; | 295 g_magnification_manager = NULL; |
| 298 } | 296 } |
| 299 | 297 |
| 300 // static | 298 // static |
| 301 MagnificationManager* MagnificationManager::Get() { | 299 MagnificationManager* MagnificationManager::Get() { |
| 302 return g_magnification_manager; | 300 return g_magnification_manager; |
| 303 } | 301 } |
| 304 | 302 |
| 305 } // namespace chromeos | 303 } // namespace chromeos |
| OLD | NEW |