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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 if (!profile_) | 99 if (!profile_) |
100 return std::numeric_limits<double>::min(); | 100 return std::numeric_limits<double>::min(); |
101 | 101 |
102 return profile_->GetPrefs()->GetDouble( | 102 return profile_->GetPrefs()->GetDouble( |
103 prefs::kAccessibilityScreenMagnifierScale); | 103 prefs::kAccessibilityScreenMagnifierScale); |
104 } | 104 } |
105 | 105 |
106 void SetProfileForTest(Profile* profile) override { SetProfile(profile); } | 106 void SetProfileForTest(Profile* profile) override { SetProfile(profile); } |
107 | 107 |
108 // SessionStateObserver overrides: | 108 // SessionStateObserver overrides: |
109 void ActiveUserChanged(const std::string& user_id) override { | 109 void ActiveUserChanged(const user_manager::UserID& user_id) override { |
110 SetProfile(ProfileManager::GetActiveUserProfile()); | 110 SetProfile(ProfileManager::GetActiveUserProfile()); |
111 } | 111 } |
112 | 112 |
113 private: | 113 private: |
114 void SetProfile(Profile* profile) { | 114 void SetProfile(Profile* profile) { |
115 pref_change_registrar_.reset(); | 115 pref_change_registrar_.reset(); |
116 | 116 |
117 if (profile) { | 117 if (profile) { |
118 // TODO(yoshiki): Move following code to PrefHandler. | 118 // TODO(yoshiki): Move following code to PrefHandler. |
119 pref_change_registrar_.reset(new PrefChangeRegistrar); | 119 pref_change_registrar_.reset(new PrefChangeRegistrar); |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 delete g_magnification_manager; | 288 delete g_magnification_manager; |
289 g_magnification_manager = NULL; | 289 g_magnification_manager = NULL; |
290 } | 290 } |
291 | 291 |
292 // static | 292 // static |
293 MagnificationManager* MagnificationManager::Get() { | 293 MagnificationManager* MagnificationManager::Get() { |
294 return g_magnification_manager; | 294 return g_magnification_manager; |
295 } | 295 } |
296 | 296 |
297 } // namespace chromeos | 297 } // namespace chromeos |
OLD | NEW |