activity_log_private.js 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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.activityLogPrivate.FooType'.
  8. // Please run the closure compiler before committing changes.
  9. // See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
  10. /** @fileoverview Externs generated from namespace: activityLogPrivate */
  11. /** @const */
  12. chrome.activityLogPrivate = {};
  13. /**
  14. * @enum {string}
  15. */
  16. chrome.activityLogPrivate.ExtensionActivityType = {
  17. API_CALL: 'api_call',
  18. API_EVENT: 'api_event',
  19. CONTENT_SCRIPT: 'content_script',
  20. DOM_ACCESS: 'dom_access',
  21. DOM_EVENT: 'dom_event',
  22. WEB_REQUEST: 'web_request',
  23. };
  24. /**
  25. * @enum {string}
  26. */
  27. chrome.activityLogPrivate.ExtensionActivityFilter = {
  28. API_CALL: 'api_call',
  29. API_EVENT: 'api_event',
  30. CONTENT_SCRIPT: 'content_script',
  31. DOM_ACCESS: 'dom_access',
  32. DOM_EVENT: 'dom_event',
  33. WEB_REQUEST: 'web_request',
  34. ANY: 'any',
  35. };
  36. /**
  37. * @enum {string}
  38. */
  39. chrome.activityLogPrivate.ExtensionActivityDomVerb = {
  40. GETTER: 'getter',
  41. SETTER: 'setter',
  42. METHOD: 'method',
  43. INSERTED: 'inserted',
  44. XHR: 'xhr',
  45. WEBREQUEST: 'webrequest',
  46. MODIFIED: 'modified',
  47. };
  48. /**
  49. * This corresponds to a row from the ActivityLog database. Fields will be blank if they were specified precisely in a lookup filter.
  50. * @typedef {{
  51. * activityId: (string|undefined),
  52. * extensionId: (string|undefined),
  53. * activityType: !chrome.activityLogPrivate.ExtensionActivityType,
  54. * time: (number|undefined),
  55. * apiCall: (string|undefined),
  56. * args: (string|undefined),
  57. * count: (number|undefined),
  58. * pageUrl: (string|undefined),
  59. * pageTitle: (string|undefined),
  60. * argUrl: (string|undefined),
  61. * other: ({
  62. * prerender: (boolean|undefined),
  63. * domVerb: (!chrome.activityLogPrivate.ExtensionActivityDomVerb|undefined),
  64. * webRequest: (string|undefined),
  65. * extra: (string|undefined)
  66. * }|undefined)
  67. * }}
  68. */
  69. chrome.activityLogPrivate.ExtensionActivity;
  70. /**
  71. * Used to specify values for a lookup.
  72. * @typedef {{
  73. * extensionId: (string|undefined),
  74. * activityType: !chrome.activityLogPrivate.ExtensionActivityFilter,
  75. * apiCall: (string|undefined),
  76. * pageUrl: (string|undefined),
  77. * argUrl: (string|undefined),
  78. * daysAgo: (number|undefined)
  79. * }}
  80. */
  81. chrome.activityLogPrivate.Filter;
  82. /**
  83. * This holds the results of a lookup, the filter of the lookup, the time of the lookup, and whether there are more results that match.
  84. * @typedef {{
  85. * activities: !Array<!chrome.activityLogPrivate.ExtensionActivity>
  86. * }}
  87. */
  88. chrome.activityLogPrivate.ActivityResultSet;
  89. /**
  90. * Retrieves activity from the ActivityLog that matches the specified filter.
  91. * @param {!chrome.activityLogPrivate.Filter} filter Fill out the fields that
  92. * you want to search for in the database.
  93. * @param {function(!chrome.activityLogPrivate.ActivityResultSet): void}
  94. * callback
  95. */
  96. chrome.activityLogPrivate.getExtensionActivities = function(filter, callback) {};
  97. /**
  98. * Deletes activities in the ActivityLog database specified in the array of
  99. * activity IDs.
  100. * @param {!Array<string>} activityIds Erases only the activities which IDs are
  101. * listed in the array.
  102. * @param {function(): void=} callback
  103. */
  104. chrome.activityLogPrivate.deleteActivities = function(activityIds, callback) {};
  105. /**
  106. * Deletes activities in the ActivityLog database specified by the extension ID.
  107. * @param {string} extensionId The ID of the extension to delete activities for.
  108. * @param {function(): void=} callback
  109. */
  110. chrome.activityLogPrivate.deleteActivitiesByExtension = function(extensionId, callback) {};
  111. /**
  112. * Deletes the entire ActivityLog database.
  113. */
  114. chrome.activityLogPrivate.deleteDatabase = function() {};
  115. /**
  116. * Delete URLs in the ActivityLog database.
  117. * @param {!Array<string>} urls Erases only the URLs listed; if empty, erases
  118. * all URLs.
  119. */
  120. chrome.activityLogPrivate.deleteUrls = function(urls) {};
  121. /**
  122. * Fired when a given extension performs another activity.
  123. * @type {!ChromeEvent}
  124. */
  125. chrome.activityLogPrivate.onExtensionActivity;