OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/magnifier_constants.h" | 7 #include "ash/magnifier/magnifier_constants.h" |
8 #include "ash/test/ash_test_base.h" | 8 #include "ash/test/ash_test_base.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 void reset() { observed_ = false; } | 35 void reset() { observed_ = false; } |
36 | 36 |
37 private: | 37 private: |
38 // content::NotificationObserver implimentation: | 38 // content::NotificationObserver implimentation: |
39 virtual void Observe(int type, | 39 virtual void Observe(int type, |
40 const content::NotificationSource& source, | 40 const content::NotificationSource& source, |
41 const content::NotificationDetails& details) OVERRIDE { | 41 const content::NotificationDetails& details) OVERRIDE { |
42 switch (type) { | 42 switch (type) { |
43 case chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER: | 43 case chrome::NOTIFICATION_CROS_ACCESSIBILITY_TOGGLE_SCREEN_MAGNIFIER: |
44 accessibility::AccessibilityStatusEventDetails* accessibility_status = | 44 AccessibilityStatusEventDetails* accessibility_status = |
45 content::Details<accessibility::AccessibilityStatusEventDetails>( | 45 content::Details<AccessibilityStatusEventDetails>(details).ptr(); |
46 details).ptr(); | |
47 | 46 |
48 observed_ = true; | 47 observed_ = true; |
49 observed_enabled_ = accessibility_status->enabled; | 48 observed_enabled_ = accessibility_status->enabled; |
50 observed_type_ = accessibility_status->magnifier_type; | 49 observed_type_ = accessibility_status->magnifier_type; |
51 } | 50 } |
52 } | 51 } |
53 | 52 |
54 bool observed_; | 53 bool observed_; |
55 bool observed_enabled_; | 54 bool observed_enabled_; |
56 ash::MagnifierType observed_type_; | 55 ash::MagnifierType observed_type_; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 SetMagnifierType(ash::MAGNIFIER_PARTIAL); | 127 SetMagnifierType(ash::MAGNIFIER_PARTIAL); |
129 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); | 128 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); |
130 | 129 |
131 // Disables magnifier, and confirm the status is set successfully. | 130 // Disables magnifier, and confirm the status is set successfully. |
132 DisableMagnifier(); | 131 DisableMagnifier(); |
133 EXPECT_FALSE(IsMagnifierEnabled()); | 132 EXPECT_FALSE(IsMagnifierEnabled()); |
134 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); | 133 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); |
135 } | 134 } |
136 | 135 |
137 } // namespace chromeos | 136 } // namespace chromeos |
OLD | NEW |