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 "ash/magnifier/magnification_controller.h" | 7 #include "ash/magnifier/magnification_controller.h" |
8 #include "ash/magnifier/partial_magnification_controller.h" | 8 #include "ash/magnifier/partial_magnification_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/system/tray/system_tray_notifier.h" | 10 #include "ash/system/tray/system_tray_notifier.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 prefs::kMagnifierType, | 95 prefs::kMagnifierType, |
96 base::Bind(&MagnificationManagerImpl::UpdateMagnifierStatus, | 96 base::Bind(&MagnificationManagerImpl::UpdateMagnifierStatus, |
97 base::Unretained(this))); | 97 base::Unretained(this))); |
98 } | 98 } |
99 | 99 |
100 profile_ = profile; | 100 profile_ = profile; |
101 UpdateMagnifierStatus(); | 101 UpdateMagnifierStatus(); |
102 } | 102 } |
103 | 103 |
104 void UpdateMagnifierStatus() { | 104 void UpdateMagnifierStatus() { |
105 UserManager* manager = UserManager::Get(); | 105 ash::MagnifierType type = GetMagnifierType(); |
106 if (!profile_) { | 106 SetMagnifier(type); |
107 SetMagnifier(ash::MAGNIFIER_OFF); | |
108 } else if (manager && !manager->IsSessionStarted()) { | |
109 SetMagnifier(ash::MAGNIFIER_FULL); | |
110 } else { | |
111 ash::MagnifierType type = GetMagnifierType(); | |
112 SetMagnifier(type); | |
113 } | |
114 } | 107 } |
115 | 108 |
116 virtual void Observe(int type, | 109 virtual void Observe(int type, |
117 const content::NotificationSource& source, | 110 const content::NotificationSource& source, |
118 const content::NotificationDetails& details) OVERRIDE { | 111 const content::NotificationDetails& details) OVERRIDE { |
119 switch (type) { | 112 switch (type) { |
120 case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: | 113 case chrome::NOTIFICATION_LOGIN_WEBUI_VISIBLE: |
121 case chrome::NOTIFICATION_SESSION_STARTED: { | 114 case chrome::NOTIFICATION_SESSION_STARTED: { |
122 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); | 115 Profile* profile = ProfileManager::GetDefaultProfileOrOffTheRecord(); |
123 SetProfile(profile); | 116 SetProfile(profile); |
(...skipping 19 matching lines...) Expand all Loading... |
143 } | 136 } |
144 | 137 |
145 MagnificationManager* MagnificationManager::CreateInstance() { | 138 MagnificationManager* MagnificationManager::CreateInstance() { |
146 // Makes sure that this is not called more than once. | 139 // Makes sure that this is not called more than once. |
147 CHECK(!GetInstance()); | 140 CHECK(!GetInstance()); |
148 | 141 |
149 return new MagnificationManagerImpl(); | 142 return new MagnificationManagerImpl(); |
150 } | 143 } |
151 | 144 |
152 } // namespace chromeos | 145 } // namespace chromeos |
OLD | NEW |