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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
6#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
7
8#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"
9
10class Profile;
11
12namespace chromeos {
13
14// MagnificationManager controls the full screen magnifier from chrome-browser
15// side (not ash side).
16//
17// MagnificationManager does:
18//   - Watch logged-in. Changes the behavior between the login screen and user
19//     desktop.
20//   - Watch change of the pref. When the pref changes, the setting of the
21//     magnifier will interlock with it.
22
23class MagnificationManager {
24 public:
25  // Creates an instance of MagnificationManager. This should be called once,
26  // Returns the existing instance. If there is no instance, creates one.
27  // because only one instance should exist at the same time.
28  static void Initialize();
29
30  // Deletes the existing instance of MagnificationManager.
31  static void Shutdown();
32
33  // Returns the existing instance. If there is no instance, returns NULL.
34  static MagnificationManager* Get();
35
36  // Returns if the screen magnifier is enabled.
37  virtual bool IsMagnifierEnabled() const = 0;
38
39  // Returns the current type of the screen magnifier.
40  virtual ash::MagnifierType GetMagnifierType() const = 0;
41
42  // Enables the screen magnifier.
43  virtual void SetMagnifierEnabled(bool enabled) = 0;
44
45  // Changes the type of the screen magnifier.
46  virtual void SetMagnifierType(ash::MagnifierType type) = 0;
47
48  // Saves the magnifier scale to the pref.
49  virtual void SaveScreenMagnifierScale(double scale) = 0;
50
51  // Loads the magnifier scale from the pref.
52  virtual double GetSavedScreenMagnifierScale() const = 0;
53
54  virtual void SetProfileForTest(Profile* profile) = 0;
55
56 protected:
57  virtual ~MagnificationManager() {}
58};
59
60}  // namespace chromeos
61
62#endif  // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
63