UMA for opening the sub-panels in the application panel

Backend CL: https://crrev.com/c/3497545

Bug: 1302922
Change-Id: If93aab2c3eac8063adc6b034ec03109a79a7d41d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3500431
Reviewed-by: Danil Somsikov <dsv@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
This commit is contained in:
Wolfgang Beyer
2022-03-04 10:35:57 +00:00
committed by Devtools-frontend LUCI CQ
parent 2f82cbd3ab
commit 79797e09f4
6 changed files with 47 additions and 1 deletions
+23 -1
View File
@@ -380,7 +380,29 @@ export enum PanelCodes {
'settings-keybinds' = 38,
'cssoverview' = 39,
'chrome_recorder' = 40,
MaxValue = 41,
'trust_tokens' = 41,
'reporting_api' = 42,
'interest_groups' = 43,
'back_forward_cache' = 44,
'service_worker_cache' = 45,
'background_service_backgroundFetch' = 46,
'background_service_backgroundSync' = 47,
'background_service_pushMessaging' = 48,
'background_service_notifications' = 49,
'background_service_paymentHandler' = 50,
'background_service_periodicBackgroundSync' = 51,
'service_workers' = 52,
'app_manifest' = 53,
'storage' = 54,
'cookies' = 55,
'frame_details' = 56,
'frame_resource' = 57,
'frame_window' = 58,
'frame_worker' = 59,
'dom_storage' = 60,
'indexed_db' = 61,
'web_sql' = 62,
MaxValue = 63,
}
/* eslint-enable @typescript-eslint/naming-convention */
@@ -7,6 +7,7 @@ import * as i18n from '../../core/i18n/i18n.js';
import * as SDK from '../../core/sdk/sdk.js';
import * as UI from '../../ui/legacy/legacy.js';
import * as ApplicationComponents from './components/components.js';
import * as Host from '../../core/host/host.js';
import {ApplicationPanelTreeElement, ExpandableApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
import type {ResourcesPanel} from './ResourcesPanel.js';
@@ -164,6 +165,7 @@ export class SWCacheTreeElement extends ApplicationPanelTreeElement {
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.service_worker_cache]);
return false;
}
@@ -192,6 +194,7 @@ export class BackForwardCacheTreeElement extends ApplicationPanelTreeElement {
this.view = new ApplicationComponents.BackForwardCacheView.BackForwardCacheViewWrapper();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.back_forward_cache]);
return false;
}
}
@@ -831,6 +831,7 @@ export class BackgroundServiceTreeElement extends ApplicationPanelTreeElement {
}
this.showView(this.view);
UI.Context.Context.instance().setFlavor(BackgroundServiceView, this.view);
Host.userMetrics.panelShown('background_service_' + this.serviceName);
return false;
}
}
@@ -854,6 +855,7 @@ export class DatabaseTreeElement extends ApplicationPanelTreeElement {
onselect(selectedByUser?: boolean): boolean {
super.onselect(selectedByUser);
this.sidebar.showDatabase(this.database);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.web_sql]);
return false;
}
@@ -891,6 +893,7 @@ export class DatabaseTableTreeElement extends ApplicationPanelTreeElement {
onselect(selectedByUser?: boolean): boolean {
super.onselect(selectedByUser);
this.sidebar.showDatabase(this.database, this.tableName);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.web_sql]);
return false;
}
}
@@ -914,6 +917,7 @@ export class ServiceWorkersTreeElement extends ApplicationPanelTreeElement {
this.view = new ServiceWorkersView();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.service_workers]);
return false;
}
}
@@ -936,6 +940,7 @@ export class AppManifestTreeElement extends ApplicationPanelTreeElement {
this.view = new AppManifestView();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.app_manifest]);
return false;
}
}
@@ -958,6 +963,7 @@ export class ClearStorageTreeElement extends ApplicationPanelTreeElement {
this.view = new StorageView();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.storage]);
return false;
}
}
@@ -1170,6 +1176,7 @@ export class IDBDatabaseTreeElement extends ApplicationPanelTreeElement {
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
return false;
}
@@ -1302,6 +1309,7 @@ export class IDBObjectStoreTreeElement extends ApplicationPanelTreeElement {
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
return false;
}
@@ -1391,6 +1399,7 @@ export class IDBIndexTreeElement extends ApplicationPanelTreeElement {
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.indexed_db]);
return false;
}
@@ -1417,6 +1426,7 @@ export class DOMStorageTreeElement extends ApplicationPanelTreeElement {
onselect(selectedByUser?: boolean): boolean {
super.onselect(selectedByUser);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.dom_storage]);
this.resourcesPanel.showDOMStorage(this.domStorage);
return false;
}
@@ -1469,6 +1479,7 @@ export class CookieTreeElement extends ApplicationPanelTreeElement {
onselect(selectedByUser?: boolean): boolean {
super.onselect(selectedByUser);
this.resourcesPanel.showCookies(this.target, this.cookieDomainInternal);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.cookies]);
return false;
}
}
@@ -1810,6 +1821,7 @@ export class FrameTreeElement extends ApplicationPanelTreeElement {
} else {
this.view.update();
}
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_details]);
this.showView(this.view);
this.listItemElement.classList.remove('hovered');
@@ -1978,6 +1990,7 @@ export class FrameResourceTreeElement extends ApplicationPanelTreeElement {
} else {
void this.panel.scheduleShowView(this.preparePreview());
}
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_resource]);
return false;
}
@@ -2065,6 +2078,7 @@ class FrameWindowTreeElement extends ApplicationPanelTreeElement {
this.view.update();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_window]);
return false;
}
@@ -2093,6 +2107,7 @@ class WorkerTreeElement extends ApplicationPanelTreeElement {
this.view.update();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.frame_worker]);
return false;
}
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as Host from '../../core/host/host.js';
import * as i18n from '../../core/i18n/i18n.js';
import * as SDK from '../../core/sdk/sdk.js';
import * as UI from '../../ui/legacy/legacy.js';
@@ -51,6 +52,7 @@ export class InterestGroupTreeElement extends ApplicationPanelTreeElement {
onselect(selectedByUser?: boolean): boolean {
super.onselect(selectedByUser);
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.interest_groups]);
return false;
}
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import * as Host from '../../core/host/host.js';
import * as i18n from '../../core/i18n/i18n.js';
import * as UI from '../../ui/legacy/legacy.js';
@@ -37,6 +38,7 @@ export class ReportingApiTreeElement extends ApplicationPanelTreeElement {
this.view = new ReportingApiView();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.reporting_api]);
return false;
}
}
@@ -9,6 +9,7 @@ import * as UI from '../../ui/legacy/legacy.js';
import {ApplicationPanelTreeElement} from './ApplicationPanelTreeElement.js';
import * as ApplicationComponents from './components/components.js';
import type {ResourcesPanel} from './ResourcesPanel.js';
import * as Host from '../../core/host/host.js';
const UIStrings = {
/**
@@ -41,6 +42,7 @@ export class TrustTokensTreeElement extends ApplicationPanelTreeElement {
this.view = new TrustTokensViewWidgetWrapper();
}
this.showView(this.view);
Host.userMetrics.panelShown(Host.UserMetrics.PanelCodes[Host.UserMetrics.PanelCodes.trust_tokens]);
return false;
}
}