| 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>( |
| 46 details).ptr(); | 46 details).ptr(); |
| 47 | 47 |
| 48 observed_ = true; | 48 observed_ = true; |
| 49 observed_enabled_ = accessibility_status->enabled; | 49 observed_enabled_ = accessibility_status->enabled; |
| 50 observed_type_ = accessibility_status->magnifier_type; | 50 observed_type_ = accessibility_status->magnifier_type; |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool observed_; | 54 bool observed_; |
| 55 bool observed_enabled_; | 55 bool observed_enabled_; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 SetMagnifierType(ash::MAGNIFIER_PARTIAL); | 128 SetMagnifierType(ash::MAGNIFIER_PARTIAL); |
| 129 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); | 129 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); |
| 130 | 130 |
| 131 // Disables magnifier, and confirm the status is set successfully. | 131 // Disables magnifier, and confirm the status is set successfully. |
| 132 DisableMagnifier(); | 132 DisableMagnifier(); |
| 133 EXPECT_FALSE(IsMagnifierEnabled()); | 133 EXPECT_FALSE(IsMagnifierEnabled()); |
| 134 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); | 134 EXPECT_EQ(GetMagnifierType(), ash::MAGNIFIER_FULL); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace chromeos | 137 } // namespace chromeos |
| OLD | NEW |