summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/api/settings_private/settings_private_api.h
blob: 07a03ece7f65a0af0edd466e16a8ed2fa82d58e0 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// Copyright 2015 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_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_

#include <string>

#include "base/macros.h"
#include "extensions/browser/extension_function.h"

namespace extensions {

// Implements the chrome.settingsPrivate.setPref method.
class SettingsPrivateSetPrefFunction : public UIThreadExtensionFunction {
 public:
  SettingsPrivateSetPrefFunction() {}
  DECLARE_EXTENSION_FUNCTION("settingsPrivate.setPref",
                             SETTINGSPRIVATE_SETPREF);

 protected:
  ~SettingsPrivateSetPrefFunction() override;

  // ExtensionFunction overrides.
  ResponseAction Run() override;

  DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetPrefFunction);
};

// Implements the chrome.settingsPrivate.getAllPrefs method.
class SettingsPrivateGetAllPrefsFunction : public UIThreadExtensionFunction {
 public:
  SettingsPrivateGetAllPrefsFunction() {}
  DECLARE_EXTENSION_FUNCTION("settingsPrivate.getAllPrefs",
                             SETTINGSPRIVATE_GETALLPREFS);

 protected:
  ~SettingsPrivateGetAllPrefsFunction() override;

  // AsyncExtensionFunction overrides.
  ResponseAction Run() override;

  DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetAllPrefsFunction);
};

// Implements the chrome.settingsPrivate.getPref method.
class SettingsPrivateGetPrefFunction : public UIThreadExtensionFunction {
 public:
  SettingsPrivateGetPrefFunction() {}
  DECLARE_EXTENSION_FUNCTION("settingsPrivate.getPref",
                             SETTINGSPRIVATE_GETPREF);

 protected:
  ~SettingsPrivateGetPrefFunction() override;

  // AsyncExtensionFunction overrides.
  ResponseAction Run() override;

  DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetPrefFunction);
};

// Implements the chrome.settingsPrivate.getDefaultZoomPercent method.
class SettingsPrivateGetDefaultZoomPercentFunction
    : public UIThreadExtensionFunction {
 public:
  SettingsPrivateGetDefaultZoomPercentFunction() {}
  DECLARE_EXTENSION_FUNCTION("settingsPrivate.getDefaultZoomPercent",
                             SETTINGSPRIVATE_GETDEFAULTZOOMPERCENTFUNCTION);

 protected:
  ~SettingsPrivateGetDefaultZoomPercentFunction() override;

  // AsyncExtensionFunction overrides.
  ResponseAction Run() override;

  DISALLOW_COPY_AND_ASSIGN(SettingsPrivateGetDefaultZoomPercentFunction);
};

// Implements the chrome.settingsPrivate.setDefaultZoomPercent method.
class SettingsPrivateSetDefaultZoomPercentFunction
    : public UIThreadExtensionFunction {
 public:
  SettingsPrivateSetDefaultZoomPercentFunction() {}
  DECLARE_EXTENSION_FUNCTION("settingsPrivate.setDefaultZoomPercent",
                             SETTINGSPRIVATE_SETDEFAULTZOOMPERCENTFUNCTION);

 protected:
  ~SettingsPrivateSetDefaultZoomPercentFunction() override;

  // AsyncExtensionFunction overrides.
  ResponseAction Run() override;

  DISALLOW_COPY_AND_ASSIGN(SettingsPrivateSetDefaultZoomPercentFunction);
};

}  // namespace extensions

#endif  // CHROME_BROWSER_EXTENSIONS_API_SETTINGS_PRIVATE_SETTINGS_PRIVATE_API_H_