Commit 1fa0f66d authored by rbpotter's avatar rbpotter Committed by Commit Bot

PDF viewer: Autogenerate externs

Autogenerate the resources_private.js externs file, and update
pdf_viewer.js to use an enum from the new autogenerated file.

Bug: 721073
Change-Id: I177d3b229f27555bf811abc7087321606f412fdd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1811499
Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699974}
parent bed349d8
......@@ -416,7 +416,8 @@ class PDFViewer {
// Request translated strings.
chrome.resourcesPrivate.getStrings(
'pdf', strings => this.handleStrings_(strings));
chrome.resourcesPrivate.Component.PDF,
strings => this.handleStrings_(strings));
// Listen for save commands from the browser.
if (chrome.mimeHandlerPrivate && chrome.mimeHandlerPrivate.onSave) {
......
......@@ -35,6 +35,7 @@ def _CheckExterns(input_api, output_api):
'file_system_provider.idl': 'file_system_provider.js',
'language_settings_private.idl': 'language_settings_private.js',
'passwords_private.idl': 'passwords_private.js',
'resources_private.idl': 'resources_private.js',
'safe_browsing_private.idl': 'safe_browsing_private.js',
'system_private.json': 'system_private.js',
'users_private.idl': 'users_private.js',
......
......@@ -2,15 +2,37 @@
// 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.resourcesPrivate.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: resourcesPrivate */
/**
* @const
*/
chrome.resourcesPrivate = {};
/**
* Records a value than can range from 1 to 1,000,000.
* @param {string} component
* @param {!function(Object)} callback Callback to handle the dictionary of
* localized strings for |component|.
* @enum {string}
*/
chrome.resourcesPrivate.Component = {
IDENTITY: 'identity',
PDF: 'pdf',
};
/**
* Gets localized strings for a component extension. Includes default WebUI
* loadTimeData values for text and language settings (fontsize, fontfamily,
* language, textdirection). See
* chrome/browser/extensions/api/resources_private/resources_private_api.cc for
* instructions on adding a new component to this API.
* @param {!chrome.resourcesPrivate.Component} component Internal chrome
* component to get strings for.
* @param {function(Object):void} callback Called with a dictionary mapping
* names to strings.
*/
chrome.resourcesPrivate.getStrings = function(component, callback) {};
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