settings_private.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. // Copyright 2021 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. // This file was generated by:
  5. // tools/json_schema_compiler/compiler.py.
  6. // NOTE: The format of types has changed. 'FooType' is now
  7. // 'chrome.settingsPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: settingsPrivate */
  11. /** @const */
  12. chrome.settingsPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.settingsPrivate.PrefType = {
  17. BOOLEAN: 'BOOLEAN',
  18. NUMBER: 'NUMBER',
  19. STRING: 'STRING',
  20. URL: 'URL',
  21. LIST: 'LIST',
  22. DICTIONARY: 'DICTIONARY',
  23. };
  24. /**
  25. * @enum {string}
  26. */
  27. chrome.settingsPrivate.ControlledBy = {
  28. DEVICE_POLICY: 'DEVICE_POLICY',
  29. USER_POLICY: 'USER_POLICY',
  30. OWNER: 'OWNER',
  31. PRIMARY_USER: 'PRIMARY_USER',
  32. EXTENSION: 'EXTENSION',
  33. PARENT: 'PARENT',
  34. CHILD_RESTRICTION: 'CHILD_RESTRICTION',
  35. };
  36. /**
  37. * @enum {string}
  38. */
  39. chrome.settingsPrivate.Enforcement = {
  40. ENFORCED: 'ENFORCED',
  41. RECOMMENDED: 'RECOMMENDED',
  42. PARENT_SUPERVISED: 'PARENT_SUPERVISED',
  43. };
  44. /**
  45. * @typedef {{
  46. * key: string,
  47. * type: !chrome.settingsPrivate.PrefType,
  48. * value: *,
  49. * controlledBy: (!chrome.settingsPrivate.ControlledBy|undefined),
  50. * controlledByName: (string|undefined),
  51. * enforcement: (!chrome.settingsPrivate.Enforcement|undefined),
  52. * recommendedValue: (*|undefined),
  53. * userSelectableValues: (!Array<*>|undefined),
  54. * userControlDisabled: (boolean|undefined),
  55. * extensionId: (string|undefined),
  56. * extensionCanBeDisabled: (boolean|undefined)
  57. * }}
  58. */
  59. chrome.settingsPrivate.PrefObject;
  60. /**
  61. * Sets a pref value.
  62. * @param {string} name The name of the pref.
  63. * @param {*} value The new value of the pref.
  64. * @param {string=} pageId An optional user metrics identifier.
  65. * @param {function(boolean): void=} callback The callback for whether the pref
  66. * was set or not.
  67. */
  68. chrome.settingsPrivate.setPref = function(name, value, pageId, callback) {};
  69. /**
  70. * Gets an array of all the prefs.
  71. * @param {function(!Array<!chrome.settingsPrivate.PrefObject>): void} callback
  72. */
  73. chrome.settingsPrivate.getAllPrefs = function(callback) {};
  74. /**
  75. * Gets the value of a specific pref.
  76. * @param {string} name
  77. * @param {function(!chrome.settingsPrivate.PrefObject): void} callback
  78. */
  79. chrome.settingsPrivate.getPref = function(name, callback) {};
  80. /**
  81. * Gets the default page zoom factor. Possible values are currently between 0.25
  82. * and 5. For a full list, see zoom::kPresetZoomFactors.
  83. * @param {function(number): void} callback
  84. */
  85. chrome.settingsPrivate.getDefaultZoom = function(callback) {};
  86. /**
  87. * Sets the page zoom factor. Must be less than 0.001 different than a value in
  88. * zoom::kPresetZoomFactors.
  89. * @param {number} zoom
  90. * @param {function(boolean): void=} callback
  91. */
  92. chrome.settingsPrivate.setDefaultZoom = function(zoom, callback) {};
  93. /**
  94. * <p>Fired when a set of prefs has changed.</p><p>|prefs| The prefs that
  95. * changed.</p>
  96. * @type {!ChromeEvent}
  97. */
  98. chrome.settingsPrivate.onPrefsChanged;