Commit 63b70443 authored by Nigel Tao's avatar Nigel Tao Committed by Commit Bot

Don't generate @see links for private externs

See https://bugs.chromium.org/p/chromium/issues/detail?id=613096#c5 for
rationale

These two files:
third_party/closure_compiler/externs/accessibility_private.js
third_party/closure_compiler/externs/autofill_private.js
were updated in this commit, as an example of the change.

A follow-up commit will update other *_private.js files.

Bug: 613096
Cq-Include-Trybots: luci.chromium.try:closure_compilation
Change-Id: Ica4ab471956052b37c8bb6a9aabe4a7502408cfb
Reviewed-on: https://chromium-review.googlesource.com/1090425
Commit-Queue: Nigel Tao <nigeltao@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568702}
parent 9fa1f15d
...@@ -21,7 +21,6 @@ chrome.accessibilityPrivate = {}; ...@@ -21,7 +21,6 @@ chrome.accessibilityPrivate = {};
* @typedef {{ * @typedef {{
* message: string * message: string
* }} * }}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-AlertInfo
*/ */
chrome.accessibilityPrivate.AlertInfo; chrome.accessibilityPrivate.AlertInfo;
...@@ -33,13 +32,11 @@ chrome.accessibilityPrivate.AlertInfo; ...@@ -33,13 +32,11 @@ chrome.accessibilityPrivate.AlertInfo;
* width: number, * width: number,
* height: number * height: number
* }} * }}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-ScreenRect
*/ */
chrome.accessibilityPrivate.ScreenRect; chrome.accessibilityPrivate.ScreenRect;
/** /**
* @enum {string} * @enum {string}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-Gesture
*/ */
chrome.accessibilityPrivate.Gesture = { chrome.accessibilityPrivate.Gesture = {
CLICK: 'click', CLICK: 'click',
...@@ -63,7 +60,6 @@ chrome.accessibilityPrivate.Gesture = { ...@@ -63,7 +60,6 @@ chrome.accessibilityPrivate.Gesture = {
/** /**
* @enum {string} * @enum {string}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-SyntheticKeyboardEventType
*/ */
chrome.accessibilityPrivate.SyntheticKeyboardEventType = { chrome.accessibilityPrivate.SyntheticKeyboardEventType = {
KEYUP: 'keyup', KEYUP: 'keyup',
...@@ -77,7 +73,6 @@ chrome.accessibilityPrivate.SyntheticKeyboardEventType = { ...@@ -77,7 +73,6 @@ chrome.accessibilityPrivate.SyntheticKeyboardEventType = {
* search: (boolean|undefined), * search: (boolean|undefined),
* shift: (boolean|undefined) * shift: (boolean|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-SyntheticKeyboardModifiers
*/ */
chrome.accessibilityPrivate.SyntheticKeyboardModifiers; chrome.accessibilityPrivate.SyntheticKeyboardModifiers;
...@@ -87,13 +82,11 @@ chrome.accessibilityPrivate.SyntheticKeyboardModifiers; ...@@ -87,13 +82,11 @@ chrome.accessibilityPrivate.SyntheticKeyboardModifiers;
* keyCode: number, * keyCode: number,
* modifiers: (!chrome.accessibilityPrivate.SyntheticKeyboardModifiers|undefined) * modifiers: (!chrome.accessibilityPrivate.SyntheticKeyboardModifiers|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-SyntheticKeyboardEvent
*/ */
chrome.accessibilityPrivate.SyntheticKeyboardEvent; chrome.accessibilityPrivate.SyntheticKeyboardEvent;
/** /**
* @enum {string} * @enum {string}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-KeyboardMode
*/ */
chrome.accessibilityPrivate.KeyboardMode = { chrome.accessibilityPrivate.KeyboardMode = {
FULL_WIDTH: 'FULL_WIDTH', FULL_WIDTH: 'FULL_WIDTH',
...@@ -102,7 +95,6 @@ chrome.accessibilityPrivate.KeyboardMode = { ...@@ -102,7 +95,6 @@ chrome.accessibilityPrivate.KeyboardMode = {
/** /**
* @enum {string} * @enum {string}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#type-SelectToSpeakState
*/ */
chrome.accessibilityPrivate.SelectToSpeakState = { chrome.accessibilityPrivate.SelectToSpeakState = {
SELECTING: 'selecting', SELECTING: 'selecting',
...@@ -115,7 +107,6 @@ chrome.accessibilityPrivate.SelectToSpeakState = { ...@@ -115,7 +107,6 @@ chrome.accessibilityPrivate.SelectToSpeakState = {
* the calling extension to provide accessibility for web contents. * the calling extension to provide accessibility for web contents.
* @param {boolean} enabled True if native accessibility support should be * @param {boolean} enabled True if native accessibility support should be
* enabled. * enabled.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setNativeAccessibilityEnabled
*/ */
chrome.accessibilityPrivate.setNativeAccessibilityEnabled = function(enabled) {}; chrome.accessibilityPrivate.setNativeAccessibilityEnabled = function(enabled) {};
...@@ -125,7 +116,6 @@ chrome.accessibilityPrivate.setNativeAccessibilityEnabled = function(enabled) {} ...@@ -125,7 +116,6 @@ chrome.accessibilityPrivate.setNativeAccessibilityEnabled = function(enabled) {}
* rectangles to draw the accessibility focus ring around. * rectangles to draw the accessibility focus ring around.
* @param {string=} color CSS-style hex color string beginning with # like * @param {string=} color CSS-style hex color string beginning with # like
* #FF9982 or #EEE. * #FF9982 or #EEE.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setFocusRing
*/ */
chrome.accessibilityPrivate.setFocusRing = function(rects, color) {}; chrome.accessibilityPrivate.setFocusRing = function(rects, color) {};
...@@ -135,7 +125,6 @@ chrome.accessibilityPrivate.setFocusRing = function(rects, color) {}; ...@@ -135,7 +125,6 @@ chrome.accessibilityPrivate.setFocusRing = function(rects, color) {};
* rectangles to draw the highlight around. * rectangles to draw the highlight around.
* @param {string} color CSS-style hex color string beginning with # like * @param {string} color CSS-style hex color string beginning with # like
* #FF9982 or #EEE. * #FF9982 or #EEE.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setHighlights
*/ */
chrome.accessibilityPrivate.setHighlights = function(rects, color) {}; chrome.accessibilityPrivate.setHighlights = function(rects, color) {};
...@@ -149,14 +138,12 @@ chrome.accessibilityPrivate.setHighlights = function(rects, color) {}; ...@@ -149,14 +138,12 @@ chrome.accessibilityPrivate.setHighlights = function(rects, color) {};
* @param {boolean} capture True if key events should be swallowed natively and * @param {boolean} capture True if key events should be swallowed natively and
* not propagated if preventDefault() gets called by the extension's * not propagated if preventDefault() gets called by the extension's
* background page. * background page.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setKeyboardListener
*/ */
chrome.accessibilityPrivate.setKeyboardListener = function(enabled, capture) {}; chrome.accessibilityPrivate.setKeyboardListener = function(enabled, capture) {};
/** /**
* Darkens or undarkens the screen. * Darkens or undarkens the screen.
* @param {boolean} enabled True to darken screen; false to undarken screen. * @param {boolean} enabled True to darken screen; false to undarken screen.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-darkenScreen
*/ */
chrome.accessibilityPrivate.darkenScreen = function(enabled) {}; chrome.accessibilityPrivate.darkenScreen = function(enabled) {};
...@@ -164,14 +151,12 @@ chrome.accessibilityPrivate.darkenScreen = function(enabled) {}; ...@@ -164,14 +151,12 @@ chrome.accessibilityPrivate.darkenScreen = function(enabled) {};
* Change the keyboard keys captured by Switch Access. * Change the keyboard keys captured by Switch Access.
* @param {!Array<number>} key_codes The key codes for the keys that will be * @param {!Array<number>} key_codes The key codes for the keys that will be
* captured. * captured.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setSwitchAccessKeys
*/ */
chrome.accessibilityPrivate.setSwitchAccessKeys = function(key_codes) {}; chrome.accessibilityPrivate.setSwitchAccessKeys = function(key_codes) {};
/** /**
* Sets current ARC app to use native ARC support. * Sets current ARC app to use native ARC support.
* @param {boolean} enabled True for ChromeVox (native), false for TalkBack. * @param {boolean} enabled True for ChromeVox (native), false for TalkBack.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-setNativeChromeVoxArcSupportForCurrentApp
*/ */
chrome.accessibilityPrivate.setNativeChromeVoxArcSupportForCurrentApp = function(enabled) {}; chrome.accessibilityPrivate.setNativeChromeVoxArcSupportForCurrentApp = function(enabled) {};
...@@ -179,14 +164,12 @@ chrome.accessibilityPrivate.setNativeChromeVoxArcSupportForCurrentApp = function ...@@ -179,14 +164,12 @@ chrome.accessibilityPrivate.setNativeChromeVoxArcSupportForCurrentApp = function
* Sends a fabricated key event. * Sends a fabricated key event.
* @param {!chrome.accessibilityPrivate.SyntheticKeyboardEvent} keyEvent The * @param {!chrome.accessibilityPrivate.SyntheticKeyboardEvent} keyEvent The
* event to send. * event to send.
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-sendSyntheticKeyEvent
*/ */
chrome.accessibilityPrivate.sendSyntheticKeyEvent = function(keyEvent) {}; chrome.accessibilityPrivate.sendSyntheticKeyEvent = function(keyEvent) {};
/** /**
* Fired whenever ChromeVox should output introduction. * Fired whenever ChromeVox should output introduction.
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#event-onIntroduceChromeVox
*/ */
chrome.accessibilityPrivate.onIntroduceChromeVox; chrome.accessibilityPrivate.onIntroduceChromeVox;
...@@ -194,7 +177,6 @@ chrome.accessibilityPrivate.onIntroduceChromeVox; ...@@ -194,7 +177,6 @@ chrome.accessibilityPrivate.onIntroduceChromeVox;
* Fired when an accessibility gesture is detected by the touch exploration * Fired when an accessibility gesture is detected by the touch exploration
* controller. * controller.
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#event-onAccessibilityGesture
*/ */
chrome.accessibilityPrivate.onAccessibilityGesture; chrome.accessibilityPrivate.onAccessibilityGesture;
...@@ -202,7 +184,6 @@ chrome.accessibilityPrivate.onAccessibilityGesture; ...@@ -202,7 +184,6 @@ chrome.accessibilityPrivate.onAccessibilityGesture;
* Fired when we first detect two fingers are held down, which can be used to * Fired when we first detect two fingers are held down, which can be used to
* toggle spoken feedback on some touch-only devices. * toggle spoken feedback on some touch-only devices.
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#event-onTwoFingerTouchStart
*/ */
chrome.accessibilityPrivate.onTwoFingerTouchStart; chrome.accessibilityPrivate.onTwoFingerTouchStart;
...@@ -210,7 +191,6 @@ chrome.accessibilityPrivate.onTwoFingerTouchStart; ...@@ -210,7 +191,6 @@ chrome.accessibilityPrivate.onTwoFingerTouchStart;
* Fired when the user is no longer holding down two fingers (including * Fired when the user is no longer holding down two fingers (including
* releasing one, holding down three, or moving them). * releasing one, holding down three, or moving them).
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#event-onTwoFingerTouchStop
*/ */
chrome.accessibilityPrivate.onTwoFingerTouchStop; chrome.accessibilityPrivate.onTwoFingerTouchStop;
...@@ -219,7 +199,6 @@ chrome.accessibilityPrivate.onTwoFingerTouchStop; ...@@ -219,7 +199,6 @@ chrome.accessibilityPrivate.onTwoFingerTouchStop;
* between selecting with the mouse, speaking, and inactive. * between selecting with the mouse, speaking, and inactive.
* @param {!chrome.accessibilityPrivate.SelectToSpeakState} state The current * @param {!chrome.accessibilityPrivate.SelectToSpeakState} state The current
* state of the Select-to-Speak extension * state of the Select-to-Speak extension
* @see https://developer.chrome.com/extensions/accessibilityPrivate#method-onSelectToSpeakStateChanged
*/ */
chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {}; chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {};
...@@ -227,6 +206,5 @@ chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {}; ...@@ -227,6 +206,5 @@ chrome.accessibilityPrivate.onSelectToSpeakStateChanged = function(state) {};
* Called when Chrome OS wants to toggle the Select-to-Speak state, between selecting * Called when Chrome OS wants to toggle the Select-to-Speak state, between selecting
* with the mouse, speaking, and inactive * with the mouse, speaking, and inactive
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/accessibilityPrivate#event-onSelectToSpeakStateChangeRequested
*/ */
chrome.accessibilityPrivate.onSelectToSpeakStateChangeRequested; chrome.accessibilityPrivate.onSelectToSpeakStateChangeRequested;
// Copyright 2017 The Chromium Authors. All rights reserved. // Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -18,7 +18,6 @@ chrome.autofillPrivate = {}; ...@@ -18,7 +18,6 @@ chrome.autofillPrivate = {};
/** /**
* @enum {string} * @enum {string}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressField
*/ */
chrome.autofillPrivate.AddressField = { chrome.autofillPrivate.AddressField = {
FULL_NAME: 'FULL_NAME', FULL_NAME: 'FULL_NAME',
...@@ -39,7 +38,6 @@ chrome.autofillPrivate.AddressField = { ...@@ -39,7 +38,6 @@ chrome.autofillPrivate.AddressField = {
* isLocal: (boolean|undefined), * isLocal: (boolean|undefined),
* isCached: (boolean|undefined) * isCached: (boolean|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AutofillMetadata
*/ */
chrome.autofillPrivate.AutofillMetadata; chrome.autofillPrivate.AutofillMetadata;
...@@ -60,7 +58,6 @@ chrome.autofillPrivate.AutofillMetadata; ...@@ -60,7 +58,6 @@ chrome.autofillPrivate.AutofillMetadata;
* languageCode: (string|undefined), * languageCode: (string|undefined),
* metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined) * metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressEntry
*/ */
chrome.autofillPrivate.AddressEntry; chrome.autofillPrivate.AddressEntry;
...@@ -69,7 +66,6 @@ chrome.autofillPrivate.AddressEntry; ...@@ -69,7 +66,6 @@ chrome.autofillPrivate.AddressEntry;
* name: (string|undefined), * name: (string|undefined),
* countryCode: (string|undefined) * countryCode: (string|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-CountryEntry
*/ */
chrome.autofillPrivate.CountryEntry; chrome.autofillPrivate.CountryEntry;
...@@ -80,7 +76,6 @@ chrome.autofillPrivate.CountryEntry; ...@@ -80,7 +76,6 @@ chrome.autofillPrivate.CountryEntry;
* isLongField: boolean, * isLongField: boolean,
* placeholder: (string|undefined) * placeholder: (string|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponent
*/ */
chrome.autofillPrivate.AddressComponent; chrome.autofillPrivate.AddressComponent;
...@@ -88,7 +83,6 @@ chrome.autofillPrivate.AddressComponent; ...@@ -88,7 +83,6 @@ chrome.autofillPrivate.AddressComponent;
* @typedef {{ * @typedef {{
* row: !Array<!chrome.autofillPrivate.AddressComponent> * row: !Array<!chrome.autofillPrivate.AddressComponent>
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponentRow
*/ */
chrome.autofillPrivate.AddressComponentRow; chrome.autofillPrivate.AddressComponentRow;
...@@ -97,7 +91,6 @@ chrome.autofillPrivate.AddressComponentRow; ...@@ -97,7 +91,6 @@ chrome.autofillPrivate.AddressComponentRow;
* components: !Array<!chrome.autofillPrivate.AddressComponentRow>, * components: !Array<!chrome.autofillPrivate.AddressComponentRow>,
* languageCode: string * languageCode: string
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-AddressComponents
*/ */
chrome.autofillPrivate.AddressComponents; chrome.autofillPrivate.AddressComponents;
...@@ -110,7 +103,6 @@ chrome.autofillPrivate.AddressComponents; ...@@ -110,7 +103,6 @@ chrome.autofillPrivate.AddressComponents;
* expirationYear: (string|undefined), * expirationYear: (string|undefined),
* metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined) * metadata: (!chrome.autofillPrivate.AutofillMetadata|undefined)
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-CreditCardEntry
*/ */
chrome.autofillPrivate.CreditCardEntry; chrome.autofillPrivate.CreditCardEntry;
...@@ -120,7 +112,6 @@ chrome.autofillPrivate.CreditCardEntry; ...@@ -120,7 +112,6 @@ chrome.autofillPrivate.CreditCardEntry;
* indexOfNewNumber: number, * indexOfNewNumber: number,
* countryCode: string * countryCode: string
* }} * }}
* @see https://developer.chrome.com/extensions/autofillPrivate#type-ValidatePhoneParams
*/ */
chrome.autofillPrivate.ValidatePhoneParams; chrome.autofillPrivate.ValidatePhoneParams;
...@@ -129,7 +120,6 @@ chrome.autofillPrivate.ValidatePhoneParams; ...@@ -129,7 +120,6 @@ chrome.autofillPrivate.ValidatePhoneParams;
* be assigned a new one and added as a new entry. * be assigned a new one and added as a new entry.
* @param {!chrome.autofillPrivate.AddressEntry} address The address entry to * @param {!chrome.autofillPrivate.AddressEntry} address The address entry to
* save. * save.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-saveAddress
*/ */
chrome.autofillPrivate.saveAddress = function(address) {}; chrome.autofillPrivate.saveAddress = function(address) {};
...@@ -137,7 +127,6 @@ chrome.autofillPrivate.saveAddress = function(address) {}; ...@@ -137,7 +127,6 @@ chrome.autofillPrivate.saveAddress = function(address) {};
* Gets the list of all countries. * Gets the list of all countries.
* @param {function(!Array<!chrome.autofillPrivate.CountryEntry>):void} callback * @param {function(!Array<!chrome.autofillPrivate.CountryEntry>):void} callback
* Callback which will be called with the countries. * Callback which will be called with the countries.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-getCountryList
*/ */
chrome.autofillPrivate.getCountryList = function(callback) {}; chrome.autofillPrivate.getCountryList = function(callback) {};
...@@ -148,7 +137,6 @@ chrome.autofillPrivate.getCountryList = function(callback) {}; ...@@ -148,7 +137,6 @@ chrome.autofillPrivate.getCountryList = function(callback) {};
* for a list of valid codes. * for a list of valid codes.
* @param {function(!chrome.autofillPrivate.AddressComponents):void} callback * @param {function(!chrome.autofillPrivate.AddressComponents):void} callback
* Callback which will be called with components. * Callback which will be called with components.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-getAddressComponents
*/ */
chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {}; chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {};
...@@ -156,7 +144,6 @@ chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {} ...@@ -156,7 +144,6 @@ chrome.autofillPrivate.getAddressComponents = function(countryCode, callback) {}
* Gets the list of addresses. * Gets the list of addresses.
* @param {function(!Array<!chrome.autofillPrivate.AddressEntry>):void} callback * @param {function(!Array<!chrome.autofillPrivate.AddressEntry>):void} callback
* Callback which will be called with the list of addresses. * Callback which will be called with the list of addresses.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-getAddressList
*/ */
chrome.autofillPrivate.getAddressList = function(callback) {}; chrome.autofillPrivate.getAddressList = function(callback) {};
...@@ -164,14 +151,12 @@ chrome.autofillPrivate.getAddressList = function(callback) {}; ...@@ -164,14 +151,12 @@ chrome.autofillPrivate.getAddressList = function(callback) {};
* Saves the given credit card. If |card| has an empty string as its ID, it will * Saves the given credit card. If |card| has an empty string as its ID, it will
* be assigned a new one and added as a new entry. * be assigned a new one and added as a new entry.
* @param {!chrome.autofillPrivate.CreditCardEntry} card The card entry to save. * @param {!chrome.autofillPrivate.CreditCardEntry} card The card entry to save.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-saveCreditCard
*/ */
chrome.autofillPrivate.saveCreditCard = function(card) {}; chrome.autofillPrivate.saveCreditCard = function(card) {};
/** /**
* Removes the entry (address or credit card) with the given ID. * Removes the entry (address or credit card) with the given ID.
* @param {string} guid ID of the entry to remove. * @param {string} guid ID of the entry to remove.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-removeEntry
*/ */
chrome.autofillPrivate.removeEntry = function(guid) {}; chrome.autofillPrivate.removeEntry = function(guid) {};
...@@ -183,7 +168,6 @@ chrome.autofillPrivate.removeEntry = function(guid) {}; ...@@ -183,7 +168,6 @@ chrome.autofillPrivate.removeEntry = function(guid) {};
* this function. * this function.
* @param {function(!Array<string>):void} callback Callback which will be called * @param {function(!Array<string>):void} callback Callback which will be called
* with validated phone numbers. * with validated phone numbers.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-validatePhoneNumbers
*/ */
chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {}; chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {};
...@@ -191,7 +175,6 @@ chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {}; ...@@ -191,7 +175,6 @@ chrome.autofillPrivate.validatePhoneNumbers = function(params, callback) {};
* Gets the list of credit cards. * Gets the list of credit cards.
* @param {function(!Array<!chrome.autofillPrivate.CreditCardEntry>):void} * @param {function(!Array<!chrome.autofillPrivate.CreditCardEntry>):void}
* callback Callback which will be called with the list of credit cards. * callback Callback which will be called with the list of credit cards.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-getCreditCardList
*/ */
chrome.autofillPrivate.getCreditCardList = function(callback) {}; chrome.autofillPrivate.getCreditCardList = function(callback) {};
...@@ -199,7 +182,6 @@ chrome.autofillPrivate.getCreditCardList = function(callback) {}; ...@@ -199,7 +182,6 @@ chrome.autofillPrivate.getCreditCardList = function(callback) {};
* Clears the data associated with a wallet card which was saved locally so that * Clears the data associated with a wallet card which was saved locally so that
* the saved copy is masked (e.g., "Card ending in 1234"). * the saved copy is masked (e.g., "Card ending in 1234").
* @param {string} guid GUID of the credit card to mask. * @param {string} guid GUID of the credit card to mask.
* @see https://developer.chrome.com/extensions/autofillPrivate#method-maskCreditCard
*/ */
chrome.autofillPrivate.maskCreditCard = function(guid) {}; chrome.autofillPrivate.maskCreditCard = function(guid) {};
...@@ -207,7 +189,6 @@ chrome.autofillPrivate.maskCreditCard = function(guid) {}; ...@@ -207,7 +189,6 @@ chrome.autofillPrivate.maskCreditCard = function(guid) {};
* Fired when the address list has changed, meaning that an entry has been * Fired when the address list has changed, meaning that an entry has been
* added, removed, or changed. |entries| The updated list of entries. * added, removed, or changed. |entries| The updated list of entries.
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/autofillPrivate#event-onAddressListChanged
*/ */
chrome.autofillPrivate.onAddressListChanged; chrome.autofillPrivate.onAddressListChanged;
...@@ -215,6 +196,5 @@ chrome.autofillPrivate.onAddressListChanged; ...@@ -215,6 +196,5 @@ chrome.autofillPrivate.onAddressListChanged;
* Fired when the credit card list has changed, meaning that an entry has been * Fired when the credit card list has changed, meaning that an entry has been
* added, removed, or changed. |entries| The updated list of entries. * added, removed, or changed. |entries| The updated list of entries.
* @type {!ChromeEvent} * @type {!ChromeEvent}
* @see https://developer.chrome.com/extensions/autofillPrivate#event-onCreditCardListChanged
*/ */
chrome.autofillPrivate.onCreditCardListChanged; chrome.autofillPrivate.onCreditCardListChanged;
...@@ -83,11 +83,11 @@ class _Generator(object): ...@@ -83,11 +83,11 @@ class _Generator(object):
def _AppendEnumJsDoc(self, c, js_type): def _AppendEnumJsDoc(self, c, js_type):
""" Given an Enum Type object, generates the Code for the enum's definition. """ Given an Enum Type object, generates the Code for the enum's definition.
""" """
(c.Sblock(line='/**', line_prefix=' * ') c.Sblock(line='/**', line_prefix=' * ')
.Append('@enum {string}') c.Append('@enum {string}')
.Append(self._js_util.GetSeeLink(self._namespace.name, 'type', self._js_util.AppendSeeLink(c, self._namespace.name, 'type',
js_type.simple_name)) js_type.simple_name)
.Eblock(' */')) c.Eblock(' */')
c.Append('%s.%s = {' % (self._GetNamespace(), js_type.name)) c.Append('%s.%s = {' % (self._GetNamespace(), js_type.name))
def get_property_name(e): def get_property_name(e):
...@@ -136,8 +136,8 @@ class _Generator(object): ...@@ -136,8 +136,8 @@ class _Generator(object):
else: else:
self._AppendTypedef(c, js_type.properties) self._AppendTypedef(c, js_type.properties)
c.Append(self._js_util.GetSeeLink(self._namespace.name, 'type', self._js_util.AppendSeeLink(c, self._namespace.name, 'type',
js_type.simple_name)) js_type.simple_name)
c.Eblock(' */') c.Eblock(' */')
var = '%s.%s' % (self._GetNamespace(), js_type.simple_name) var = '%s.%s' % (self._GetNamespace(), js_type.simple_name)
...@@ -192,8 +192,7 @@ class _Generator(object): ...@@ -192,8 +192,7 @@ class _Generator(object):
if (event.description): if (event.description):
c.Comment(event.description, comment_prefix='') c.Comment(event.description, comment_prefix='')
c.Append('@type {!ChromeEvent}') c.Append('@type {!ChromeEvent}')
c.Append(self._js_util.GetSeeLink(self._namespace.name, 'event', self._js_util.AppendSeeLink(c, self._namespace.name, 'event', event.name)
event.name))
c.Eblock(' */') c.Eblock(' */')
c.Append('%s.%s;' % (self._GetNamespace(), event.name)) c.Append('%s.%s;' % (self._GetNamespace(), event.name))
c.Append() c.Append()
......
...@@ -89,7 +89,7 @@ namespace fakeApi { ...@@ -89,7 +89,7 @@ namespace fakeApi {
""" """
# The output we expect from our fake idl file. # The output we expect from our fake idl file.
expected_output = """// Copyright %s The Chromium Authors. All rights reserved. fake_idl_expected = """// Copyright %s The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -221,6 +221,73 @@ chrome.fakeApi.optionalParam = function(callback) {}; ...@@ -221,6 +221,73 @@ chrome.fakeApi.optionalParam = function(callback) {};
*/ */
chrome.fakeApi.onTrapDetected;""" % datetime.now().year chrome.fakeApi.onTrapDetected;""" % datetime.now().year
# A subset of fake_idl. The key difference is that the namespace is private,
# which means that @see links shouldn't be generated.
fake_private_idl = """
// Copyright 2014 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.
// A totally fake API.
namespace fakeApiPrivate {
enum Greek {
ALPHA,
BETA,
GAMMA,
DELTA
};
dictionary Bar {
long num;
};
interface Events {
// Fired when we realize it's a trap!
static void onTrapDetected(Baz baz);
};
};
"""
fake_private_idl_expected = """// Copyright %s 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.
// This file was generated by:
// tools/json_schema_compiler/compiler.py.
// NOTE: The format of types has changed. 'FooType' is now
// 'chrome.fakeApiPrivate.FooType'.
// Please run the closure compiler before committing changes.
// See https://chromium.googlesource.com/chromium/src/+/master/docs/closure_compilation.md
/** @fileoverview Externs generated from namespace: fakeApiPrivate */
/**
* @const
*/
chrome.fakeApiPrivate = {};
/**
* @enum {string}
*/
chrome.fakeApiPrivate.Greek = {
ALPHA: 'ALPHA',
BETA: 'BETA',
GAMMA: 'GAMMA',
DELTA: 'DELTA',
};
/**
* @typedef {{
* num: number
* }}
*/
chrome.fakeApiPrivate.Bar;
/**
* Fired when we realize it's a trap!
* @type {!ChromeEvent}
*/
chrome.fakeApiPrivate.onTrapDetected;""" % datetime.now().year
fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved. fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
...@@ -296,7 +363,7 @@ fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved. ...@@ -296,7 +363,7 @@ fake_json = """// Copyright 2014 The Chromium Authors. All rights reserved.
} }
]""" ]"""
json_expected = """// Copyright %s The Chromium Authors. All rights reserved. fake_json_expected = """// Copyright %s The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -361,12 +428,18 @@ class JsExternGeneratorTest(unittest.TestCase): ...@@ -361,12 +428,18 @@ class JsExternGeneratorTest(unittest.TestCase):
def testBasic(self): def testBasic(self):
namespace = self._GetNamespace(fake_idl, 'fake_api.idl', True) namespace = self._GetNamespace(fake_idl, 'fake_api.idl', True)
self.assertMultiLineEqual(expected_output, self.assertMultiLineEqual(fake_idl_expected,
JsExternsGenerator().Generate(namespace).Render())
def testPrivate(self):
namespace = self._GetNamespace(fake_private_idl, 'fake_api_private.idl',
True)
self.assertMultiLineEqual(fake_private_idl_expected,
JsExternsGenerator().Generate(namespace).Render()) JsExternsGenerator().Generate(namespace).Render())
def testJsonWithInlineObjects(self): def testJsonWithInlineObjects(self):
namespace = self._GetNamespace(fake_json, 'fake_api.json', False) namespace = self._GetNamespace(fake_json, 'fake_api.json', False)
self.assertMultiLineEqual(json_expected, self.assertMultiLineEqual(fake_json_expected,
JsExternsGenerator().Generate(namespace).Render()) JsExternsGenerator().Generate(namespace).Render())
......
...@@ -92,8 +92,7 @@ class _Generator(object): ...@@ -92,8 +92,7 @@ class _Generator(object):
if (event.description): if (event.description):
c.Comment(event.description, comment_prefix='') c.Comment(event.description, comment_prefix='')
c.Append('@type {!ChromeEvent}') c.Append('@type {!ChromeEvent}')
c.Append(self._js_util.GetSeeLink(self._namespace.name, 'event', self._js_util.AppendSeeLink(c, self._namespace.name, 'event', event.name)
event.name))
c.Eblock(' */') c.Eblock(' */')
c.Append('%s.prototype.%s;' % (self._interface, event.name)) c.Append('%s.prototype.%s;' % (self._interface, event.name))
......
...@@ -72,7 +72,7 @@ namespace fakeApi { ...@@ -72,7 +72,7 @@ namespace fakeApi {
""" """
# The output we expect from our fake idl file. # The output we expect from our fake idl file.
expected_output = ("""// Copyright %s The Chromium Authors. All rights reserved. fake_idl_output = ("""// Copyright %s The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
...@@ -126,7 +126,7 @@ class JsExternGeneratorTest(unittest.TestCase): ...@@ -126,7 +126,7 @@ class JsExternGeneratorTest(unittest.TestCase):
def testBasic(self): def testBasic(self):
namespace = self._GetNamespace(fake_idl, 'fake_api.idl') namespace = self._GetNamespace(fake_idl, 'fake_api.idl')
self.assertMultiLineEqual( self.assertMultiLineEqual(
expected_output, fake_idl_output,
JsInterfaceGenerator().Generate(namespace).Render()) JsInterfaceGenerator().Generate(namespace).Render())
......
...@@ -97,7 +97,7 @@ class JsUtil(object): ...@@ -97,7 +97,7 @@ class JsUtil(object):
if function.deprecated: if function.deprecated:
c.Append('@deprecated %s' % function.deprecated) c.Append('@deprecated %s' % function.deprecated)
c.Append(self.GetSeeLink(namespace_name, 'method', function.name)) self.AppendSeeLink(c, namespace_name, 'method', function.name)
c.Eblock(' */') c.Eblock(' */')
...@@ -174,14 +174,22 @@ class JsUtil(object): ...@@ -174,14 +174,22 @@ class JsUtil(object):
return Code().Append(js_type.property_type.name) return Code().Append(js_type.property_type.name)
return Code().Append('?') # TODO(tbreisacher): Make this more specific. return Code().Append('?') # TODO(tbreisacher): Make this more specific.
def GetSeeLink(self, namespace_name, object_type, object_name): def AppendSeeLink(self, c, namespace_name, object_type, object_name):
"""Returns a @see link for a given API 'object' (type, method, or event). """Appends a @see link for a given API 'object' (type, method, or event).
""" """
# TODO(nigeltao): this should actually be gated on if there is
# documentation, rather than if it's a private API. Most private APIs
# aren't documented, but some are. For example:
# - https://developer.chrome.com/apps/developerPrivate exists
# - https://developer.chrome.com/apps/screenlockPrivate does not
if namespace_name.endswith('Private'):
return
# NOTE(devlin): This is kind of a hack. Some APIs will be hosted on # NOTE(devlin): This is kind of a hack. Some APIs will be hosted on
# developer.chrome.com/apps/ instead of /extensions/, and some APIs have # developer.chrome.com/apps/ instead of /extensions/, and some APIs have
# '.'s in them (like app.window), which should resolve to 'app_window'. # '.'s in them (like app.window), which should resolve to 'app_window'.
# Luckily, the doc server has excellent url resolution, and knows exactly # Luckily, the doc server has excellent url resolution, and knows exactly
# what we mean. This saves us from needing any complicated logic here. # what we mean. This saves us from needing any complicated logic here.
return ('@see https://developer.chrome.com/extensions/%s#%s-%s' % c.Append('@see https://developer.chrome.com/extensions/%s#%s-%s' %
(namespace_name, object_type, object_name)) (namespace_name, object_type, object_name))
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment