chrome://ukm: Update to JS modules
Bug: 1173575 Change-Id: Id6531bb157830487cc33429105400ba1fbea95ae Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2796121 Reviewed-by: Avi Drissman <avi@chromium.org> Reviewed-by: dpapad <dpapad@chromium.org> Commit-Queue: Rebekah Potter <rbpotter@chromium.org> Cr-Commit-Position: refs/heads/master@{#868121}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
89355e68e6
commit
2c4dabba01
@ -4,14 +4,6 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<meta charset="utf-8">
|
||||
<script src="chrome://resources/js/cr.js"></script>
|
||||
<script src="chrome://resources/js/assert.js"></script>
|
||||
<script src="chrome://resources/js/promise_resolver.js"></script>
|
||||
<script src="chrome://resources/js/util.js"></script>
|
||||
<if expr="is_ios">
|
||||
<!-- TODO(crbug.com/487000): Remove this once injected by web. -->
|
||||
<script src="chrome://resources/js/ios/web_ui.js"></script>
|
||||
</if>
|
||||
<link rel="stylesheet" type="text/css" href="ukm_internals.css">
|
||||
<title>UKM Debug page</title>
|
||||
<div class="ukm_collection_status">
|
||||
@ -47,5 +39,5 @@
|
||||
<button id="clear">Clear</button>
|
||||
<button id="refresh">Refresh</button>
|
||||
<div id="sources"></div>
|
||||
<script src="ukm_internals.js"></script>
|
||||
<script type="module" src="ukm_internals.js"></script>
|
||||
</html>
|
||||
|
@ -2,6 +2,13 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
// <if expr="is_ios">
|
||||
import 'chrome://resources/js/ios/web_ui.js';
|
||||
// </if>
|
||||
|
||||
import {sendWithPromise} from 'chrome://resources/js/cr.m.js';
|
||||
import {$, createElementWithClassName} from 'chrome://resources/js/util.m.js';
|
||||
|
||||
/**
|
||||
* @typedef {{
|
||||
* name: string,
|
||||
@ -268,7 +275,7 @@ function addClearButton() {
|
||||
const clearButton = $('clear');
|
||||
clearButton.addEventListener('click', () => {
|
||||
// Note it won't be able to clear if UKM logs got cut during this call.
|
||||
cr.sendWithPromise('requestUkmData').then((/** @type {UkmData} */ data) => {
|
||||
sendWithPromise('requestUkmData').then((/** @type {UkmData} */ data) => {
|
||||
updateUkmCache(data);
|
||||
for (const s of CachedSources.values()) {
|
||||
ClearedSources.set(as64Bit(s.id), s.entries.length);
|
||||
@ -352,7 +359,7 @@ function updateUkmCache(data) {
|
||||
* list.
|
||||
*/
|
||||
function updateUkmData() {
|
||||
cr.sendWithPromise('requestUkmData').then((/** @type {UkmData} */ data) => {
|
||||
sendWithPromise('requestUkmData').then((/** @type {UkmData} */ data) => {
|
||||
updateUkmCache(data);
|
||||
if ($('include_cache').checked) {
|
||||
data.sources = [...CachedSources.values()];
|
||||
|
@ -31,8 +31,8 @@ Other resources that belong in this file:
|
||||
<include name="IDR_ORIGIN_MOJO_JS" file="${root_gen_dir}/url/mojom/origin.mojom-lite.js" resource_path="mojo/url/mojom/origin.mojom-lite.js" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_ORIGIN_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/url/mojom/origin.mojom-webui.js" resource_path="mojo/url/mojom/origin.mojom-webui.js" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_TOKEN_MOJO_WEBUI_JS" file="${root_gen_dir}/mojom-webui/mojo/public/mojom/base/token.mojom-webui.js" resource_path="mojo/mojo/public/mojom/base/token.mojom-webui.js" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_UKM_INTERNALS_HTML" file="../components/ukm/debug/ukm_internals.html" flattenhtml="true" allowexternalscript="true" type="BINDATA" />
|
||||
<include name="IDR_UKM_INTERNALS_JS" file="../components/ukm/debug/ukm_internals.js" type="BINDATA" />
|
||||
<include name="IDR_UKM_INTERNALS_HTML" file="../components/ukm/debug/ukm_internals.html" type="BINDATA" />
|
||||
<include name="IDR_UKM_INTERNALS_JS" file="../components/ukm/debug/ukm_internals.js" preprocess="true" type="BINDATA" />
|
||||
<include name="IDR_UKM_INTERNALS_CSS" file="../components/ukm/debug/ukm_internals.css" type="BINDATA" />
|
||||
<include name="IDR_UNGUESSABLE_TOKEN_MOJO_HTML" file="${root_gen_dir}/mojo/public/mojom/base/unguessable_token.mojom.html" resource_path="mojo/mojo/public/mojom/base/unguessable_token.mojom.html" use_base_dir="false" type="BINDATA" />
|
||||
<include name="IDR_UNGUESSABLE_TOKEN_MOJO_JS" file="${root_gen_dir}/mojo/public/mojom/base/unguessable_token.mojom-lite.js" resource_path="mojo/mojo/public/mojom/base/unguessable_token.mojom-lite.js" use_base_dir="false" type="BINDATA" />
|
||||
|
Reference in New Issue
Block a user