Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6259)

Unified Diff: chrome/common/extensions/api/tabs.json

Issue 1055673002: [Extensions API] Remove inline enums (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/api/tabs.json
diff --git a/chrome/common/extensions/api/tabs.json b/chrome/common/extensions/api/tabs.json
index f187633f27275ca31d338ae9af7d07730fb73049..583ff92f33889cc10f73a8b9a9a90d7440b809ae 100644
--- a/chrome/common/extensions/api/tabs.json
+++ b/chrome/common/extensions/api/tabs.json
@@ -31,43 +31,53 @@
}
},
{
+ "id": "ZoomSettingsMode",
+ "type": "string",
+ "description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.",
+ "enum": [
+ {
+ "name": "automatic",
+ "description": "Zoom changes are handled automatically by the browser."
+ },
+ {
+ "name": "manual",
+ "description": "Overrides the automatic handling of zoom changes. The <code>onZoomChange</code> event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support <code>per-origin</code> zooming, and will thus ignore the <code>scope</code> zoom setting and assume <code>per-tab</code>."
+ },
+ {
+ "name": "disabled",
+ "description": "Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored."
+ }
+ ]
+ },
+ {
+ "id": "ZoomSettingsScope",
+ "type": "string",
+ "description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.",
+ "enum": [
+ {
+ "name": "per-origin",
+ "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The <code>per-origin</code> scope is only available in the <code>automatic</code> mode."
+ },
+ {
+ "name": "per-tab",
+ "description": "Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, <code>per-tab</code> zoom changes are reset on navigation; navigating a tab will always load pages with their <code>per-origin</code> zoom factors."
+ }
+ ]
+ },
+ {
"id": "ZoomSettings",
"type": "object",
"description": "Defines how zoom changes in a tab are handled and at what scope.",
"properties": {
"mode": {
- "type": "string",
+ "$ref": "ZoomSettingsMode",
"description": "Defines how zoom changes are handled, i.e. which entity is responsible for the actual scaling of the page; defaults to <code>automatic</code>.",
- "optional": true,
- "enum": [
- {
- "name": "automatic",
- "description": "Zoom changes are handled automatically by the browser."
- },
- {
- "name": "manual",
- "description": "Overrides the automatic handling of zoom changes. The <code>onZoomChange</code> event will still be dispatched, and it is the responsibility of the extension to listen for this event and manually scale the page. This mode does not support <code>per-origin</code> zooming, and will thus ignore the <code>scope</code> zoom setting and assume <code>per-tab</code>."
- },
- {
- "name": "disabled",
- "description": "Disables all zooming in the tab. The tab will revert to the default zoom level, and all attempted zoom changes will be ignored."
- }
- ]
+ "optional": true
},
"scope": {
- "type": "string",
+ "$ref": "ZoomSettingsScope",
"description": "Defines whether zoom changes will persist for the page's origin, or only take effect in this tab; defaults to <code>per-origin</code> when in <code>automatic</code> mode, and <code>per-tab</code> otherwise.",
- "optional": true,
- "enum": [
- {
- "name": "per-origin",
- "description": "Zoom changes will persist in the zoomed page's origin, i.e. all other tabs navigated to that same origin will be zoomed as well. Moreover, <code>per-origin</code> zoom changes are saved with the origin, meaning that when navigating to other pages in the same origin, they will all be zoomed to the same zoom factor. The <code>per-origin</code> scope is only available in the <code>automatic</code> mode."
- },
- {
- "name": "per-tab",
- "description": "Zoom changes only take effect in this tab, and zoom changes in other tabs will not affect the zooming of this tab. Also, <code>per-tab</code> zoom changes are reset on navigation; navigating a tab will always load pages with their <code>per-origin</code> zoom factors."
- }
- ]
+ "optional": true
},
"default_zoom_factor": {
"type": "number",
@@ -76,6 +86,18 @@
"description": "Used to return the default zoom level for the current tab in calls to tabs.getZoomSettings."
}
}
+ },
+ {
+ "id": "TabStatus",
+ "type": "string",
+ "enum": ["loading", "complete"],
+ "description": "Whether the tabs have completed loading."
+ },
+ {
+ "id": "WindowType",
+ "type": "string",
+ "enum": ["normal", "popup", "panel", "app"],
+ "description": "The type of window."
}
],
"functions": [
@@ -388,9 +410,8 @@
"description": "Whether the tabs are in the last focused window."
},
"status": {
- "type": "string",
+ "$ref": "TabStatus",
"optional": true,
- "enum": ["loading", "complete"],
"description": "Whether the tabs have completed loading."
},
"title": {
@@ -413,9 +434,8 @@
"description": "The ID of the parent window, or $(ref:windows.WINDOW_ID_CURRENT) for the <a href='windows#current-window'>current window</a>."
},
"windowType": {
- "type": "string",
+ "$ref": "WindowType",
"optional": true,
- "enum": ["normal", "popup", "panel", "app"],
"description": "The type of window the tabs are in."
},
"index": {
« no previous file with comments | « chrome/common/extensions/api/system_private.json ('k') | chrome/common/extensions/api/terminal_private.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698