Mark private message handlers

This commit is contained in:
toasted-nutbread 2019-12-15 17:06:56 -05:00
parent 525a3a50d1
commit 8a127e07f3

View File

@ -39,15 +39,15 @@ class PopupProxyHost {
if (typeof frameId !== 'number') { return; } if (typeof frameId !== 'number') { return; }
this.apiReceiver = new FrontendApiReceiver(`popup-proxy-host#${frameId}`, new Map([ this.apiReceiver = new FrontendApiReceiver(`popup-proxy-host#${frameId}`, new Map([
['createNestedPopup', ({parentId}) => this.createNestedPopup(parentId)], ['createNestedPopup', ({parentId}) => this._onApiCreateNestedPopup(parentId)],
['setOptions', ({id, options}) => this.setOptions(id, options)], ['setOptions', ({id, options}) => this._onApiSetOptions(id, options)],
['hide', ({id, changeFocus}) => this.hide(id, changeFocus)], ['hide', ({id, changeFocus}) => this._onApiHide(id, changeFocus)],
['isVisibleAsync', ({id}) => this.isVisibleAsync(id)], ['isVisibleAsync', ({id}) => this._onApiIsVisibleAsync(id)],
['setVisibleOverride', ({id, visible}) => this.setVisibleOverride(id, visible)], ['setVisibleOverride', ({id, visible}) => this._onApiSetVisibleOverride(id, visible)],
['containsPoint', ({id, x, y}) => this.containsPoint(id, x, y)], ['containsPoint', ({id, x, y}) => this._onApiContainsPoint(id, x, y)],
['showContent', ({id, elementRect, writingMode, type, details}) => this.showContent(id, elementRect, writingMode, type, details)], ['showContent', ({id, elementRect, writingMode, type, details}) => this._onApiShowContent(id, elementRect, writingMode, type, details)],
['setCustomCss', ({id, css}) => this.setCustomCss(id, css)], ['setCustomCss', ({id, css}) => this._onApiSetCustomCss(id, css)],
['clearAutoPlayTimer', ({id}) => this.clearAutoPlayTimer(id)] ['clearAutoPlayTimer', ({id}) => this._onApiClearAutoPlayTimer(id)]
])); ]));
} }
@ -69,48 +69,48 @@ class PopupProxyHost {
// Message handlers // Message handlers
async createNestedPopup(parentId) { async _onApiCreateNestedPopup(parentId) {
return this.createPopup(parentId, 0).id; return this.createPopup(parentId, 0).id;
} }
async setOptions(id, options) { async _onApiSetOptions(id, options) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return await popup.setOptions(options); return await popup.setOptions(options);
} }
async hide(id, changeFocus) { async _onApiHide(id, changeFocus) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return popup.hide(changeFocus); return popup.hide(changeFocus);
} }
async isVisibleAsync(id) { async _onApiIsVisibleAsync(id) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return await popup.isVisibleAsync(); return await popup.isVisibleAsync();
} }
async setVisibleOverride(id, visible) { async _onApiSetVisibleOverride(id, visible) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return await popup.setVisibleOverride(visible); return await popup.setVisibleOverride(visible);
} }
async containsPoint(id, x, y) { async _onApiContainsPoint(id, x, y) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return await popup.containsPoint(x, y); return await popup.containsPoint(x, y);
} }
async showContent(id, elementRect, writingMode, type, details) { async _onApiShowContent(id, elementRect, writingMode, type, details) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
elementRect = PopupProxyHost._convertJsonRectToDOMRect(popup, elementRect); elementRect = PopupProxyHost._convertJsonRectToDOMRect(popup, elementRect);
if (!PopupProxyHost._popupCanShow(popup)) { return Promise.resolve(false); } if (!PopupProxyHost._popupCanShow(popup)) { return Promise.resolve(false); }
return await popup.showContent(elementRect, writingMode, type, details); return await popup.showContent(elementRect, writingMode, type, details);
} }
async setCustomCss(id, css) { async _onApiSetCustomCss(id, css) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return popup.setCustomCss(css); return popup.setCustomCss(css);
} }
async clearAutoPlayTimer(id) { async _onApiClearAutoPlayTimer(id) {
const popup = this._getPopup(id); const popup = this._getPopup(id);
return popup.clearAutoPlayTimer(); return popup.clearAutoPlayTimer();
} }