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 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
23 #include "chrome/browser/profiles/profile_manager.h" | 23 #include "chrome/browser/profiles/profile_manager.h" |
24 #include "chrome/common/pref_names.h" | 24 #include "chrome/common/pref_names.h" |
25 #include "content/public/browser/focused_node_details.h" | 25 #include "content/public/browser/focused_node_details.h" |
26 #include "content/public/browser/notification_details.h" | 26 #include "content/public/browser/notification_details.h" |
27 #include "content/public/browser/notification_observer.h" | 27 #include "content/public/browser/notification_observer.h" |
28 #include "content/public/browser/notification_registrar.h" | 28 #include "content/public/browser/notification_registrar.h" |
29 #include "content/public/browser/notification_service.h" | 29 #include "content/public/browser/notification_service.h" |
30 #include "content/public/browser/notification_source.h" | 30 #include "content/public/browser/notification_source.h" |
31 | 31 |
| 32 class AccountId; |
| 33 |
32 namespace chromeos { | 34 namespace chromeos { |
33 | 35 |
34 namespace { | 36 namespace { |
35 static MagnificationManager* g_magnification_manager = NULL; | 37 static MagnificationManager* g_magnification_manager = NULL; |
36 } | 38 } |
37 | 39 |
38 class MagnificationManagerImpl : public MagnificationManager, | 40 class MagnificationManagerImpl : public MagnificationManager, |
39 public content::NotificationObserver, | 41 public content::NotificationObserver, |
40 public ash::SessionStateObserver { | 42 public ash::SessionStateObserver { |
41 public: | 43 public: |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 if (!profile_) | 102 if (!profile_) |
101 return std::numeric_limits<double>::min(); | 103 return std::numeric_limits<double>::min(); |
102 | 104 |
103 return profile_->GetPrefs()->GetDouble( | 105 return profile_->GetPrefs()->GetDouble( |
104 prefs::kAccessibilityScreenMagnifierScale); | 106 prefs::kAccessibilityScreenMagnifierScale); |
105 } | 107 } |
106 | 108 |
107 void SetProfileForTest(Profile* profile) override { SetProfile(profile); } | 109 void SetProfileForTest(Profile* profile) override { SetProfile(profile); } |
108 | 110 |
109 // SessionStateObserver overrides: | 111 // SessionStateObserver overrides: |
110 void ActiveUserChanged(const std::string& user_id) override { | 112 void ActiveUserChanged(const AccountId& /* account_id */) override { |
111 SetProfile(ProfileManager::GetActiveUserProfile()); | 113 SetProfile(ProfileManager::GetActiveUserProfile()); |
112 } | 114 } |
113 | 115 |
114 private: | 116 private: |
115 void SetProfile(Profile* profile) { | 117 void SetProfile(Profile* profile) { |
116 pref_change_registrar_.reset(); | 118 pref_change_registrar_.reset(); |
117 | 119 |
118 if (profile) { | 120 if (profile) { |
119 // TODO(yoshiki): Move following code to PrefHandler. | 121 // TODO(yoshiki): Move following code to PrefHandler. |
120 pref_change_registrar_.reset(new PrefChangeRegistrar); | 122 pref_change_registrar_.reset(new PrefChangeRegistrar); |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 delete g_magnification_manager; | 313 delete g_magnification_manager; |
312 g_magnification_manager = NULL; | 314 g_magnification_manager = NULL; |
313 } | 315 } |
314 | 316 |
315 // static | 317 // static |
316 MagnificationManager* MagnificationManager::Get() { | 318 MagnificationManager* MagnificationManager::Get() { |
317 return g_magnification_manager; | 319 return g_magnification_manager; |
318 } | 320 } |
319 | 321 |
320 } // namespace chromeos | 322 } // namespace chromeos |
OLD | NEW |