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 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ |
7 | 7 |
8 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" | 8 #include "chrome/browser/chromeos/accessibility/accessibility_util.h" |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
11 | 11 |
| 12 class MagnificationObserver { |
| 13 public: |
| 14 virtual void OnMagnifierTypeChanged(ash::MagnifierType new_type) = 0; |
| 15 }; |
| 16 |
12 // MagnificationManager controls the full screen magnifier from chrome-browser | 17 // MagnificationManager controls the full screen magnifier from chrome-browser |
13 // side (not ash side). | 18 // side (not ash side). |
14 // | 19 // |
15 // MagnificationManager does: | 20 // MagnificationManager does: |
16 // - Watch logged-in. Changes the behavior between the login screen and user | 21 // - Watch logged-in. Changes the behavior between the login screen and user |
17 // desktop. | 22 // desktop. |
18 // - Watch change of the pref. When the pref changes, the setting of the | 23 // - Watch change of the pref. When the pref changes, the setting of the |
19 // magnifier will interlock with it. | 24 // magnifier will interlock with it. |
20 | 25 |
21 class MagnificationManager { | 26 class MagnificationManager { |
22 public: | 27 public: |
23 // Creates an instance of MagnificationManager. This should be called once, | 28 // Creates an instance of MagnificationManager. This should be called once, |
| 29 // Returns the existing instance. If there is no instance, creates one. |
24 // because only one instance should exist at the same time. | 30 // because only one instance should exist at the same time. |
25 static MagnificationManager* CreateInstance(); | 31 static void Initialize(); |
| 32 // Deletes the existing instance of MagnificationManager. |
| 33 static void Shutdown(); |
26 // Returns the existing instance. If there is no instance, returns NULL. | 34 // Returns the existing instance. If there is no instance, returns NULL. |
27 static MagnificationManager* GetInstance(); | 35 static MagnificationManager* Get(); |
28 | 36 |
29 virtual ~MagnificationManager() {} | 37 virtual void AddObserver(MagnificationObserver* observer) = 0; |
| 38 virtual void RemoveObserver(MagnificationObserver* observer) = 0; |
30 | 39 |
31 // Returns the current type of the screen magnifier. | 40 // Returns the current type of the screen magnifier. |
32 virtual ash::MagnifierType GetMagnifierType() = 0; | 41 virtual ash::MagnifierType GetMagnifierType() = 0; |
33 // Changes the type of the screen magnifier. | 42 // Changes the type of the screen magnifier. |
34 virtual void SetMagnifier(ash::MagnifierType type) = 0; | 43 virtual void SetMagnifier(ash::MagnifierType type) = 0; |
| 44 |
| 45 protected: |
| 46 virtual ~MagnificationManager() {} |
35 }; | 47 }; |
36 | 48 |
37 } // namespace chromeos | 49 } // namespace chromeos |
38 | 50 |
39 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ | 51 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_ |
OLD | NEW |