summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/accessibility/magnification_manager.h
blob: 0defb89c3f307df3de8950204f37635980ac727d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_
#define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_

#include "chrome/browser/chromeos/accessibility/accessibility_manager.h"

class Profile;

namespace chromeos {

// MagnificationManager controls the full screen magnifier from chrome-browser
// side (not ash side).
//
// MagnificationManager does:
//   - Watch logged-in. Changes the behavior between the login screen and user
//     desktop.
//   - Watch change of the pref. When the pref changes, the setting of the
//     magnifier will interlock with it.

class MagnificationManager {
 public:
  // Creates an instance of MagnificationManager. This should be called once,
  // Returns the existing instance. If there is no instance, creates one.
  // because only one instance should exist at the same time.
  static void Initialize();

  // Deletes the existing instance of MagnificationManager.
  static void Shutdown();

  // Returns the existing instance. If there is no instance, returns NULL.
  static MagnificationManager* Get();

  // Returns if the screen magnifier is enabled.
  virtual bool IsMagnifierEnabled() const = 0;

  // Returns the current type of the screen magnifier.
  virtual ui::MagnifierType GetMagnifierType() const = 0;

  // Enables the screen magnifier.
  virtual void SetMagnifierEnabled(bool enabled) = 0;

  // Changes the type of the screen magnifier.
  virtual void SetMagnifierType(ui::MagnifierType type) = 0;

  // Saves the magnifier scale to the pref.
  virtual void SaveScreenMagnifierScale(double scale) = 0;

  // Loads the magnifier scale from the pref.
  virtual double GetSavedScreenMagnifierScale() const = 0;

  virtual void SetProfileForTest(Profile* profile) = 0;

 protected:
  virtual ~MagnificationManager() {}
};

}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_MAGNIFICATION_MANAGER_H_