Skip to content

Commit 751b2a8

Browse files
jalonthomasDevtools-frontend LUCI CQ
authored andcommitted
Add deprecation message for 'Privacy' section of the 'Privacy & Security' panel
The first step toward deprecating the 'Privacy' section to align with Chrome's decision to maintain its current approach to user choice for third-party cookies. Mocks can be found under 'User Notification' in this deprecation plan doc: http://docs/document/d/1-NuVEYMME-Xla0BY4BgbCRHPnqko_Ecf8O--zwXi6ug?resourcekey=0-y4svRJeCuNQcrfxw0OkmdA&tab=t.0#heading=h.ke47sslzyi8w Bug:462017663 Change-Id: I952d18417f6982f4306a467a4575d47300172f7f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/7275937 Reviewed-by: Paul Irish <paulirish@chromium.org> Reviewed-by: Peter Müller <petermueller@chromium.org> Commit-Queue: Jalon Thomas <jalonthomas@google.com>
1 parent b116a57 commit 751b2a8

File tree

5 files changed

+104
-1
lines changed

5 files changed

+104
-1
lines changed

front_end/panels/security/CookieControlsView.ts

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,20 @@ const UIStrings = {
101101
* @example {#tpcd-heuristics-grants} PH1
102102
*/
103103
enableFlag: 'To use this, set {PH1} to Default',
104+
/**
105+
* @description First part of the deprecation warning message.
106+
* @example {maintaining its current approach to user choice for third-party cookies} PH1
107+
*/
108+
upperDeprecationWarning: 'Chrome is {PH1} and third-party cookie exceptions are being phased out.',
109+
/**
110+
* @description Text for the blog post link inside the deprecation warning.
111+
*/
112+
blogPostLink: 'maintaining its current approach to user choice for third-party cookies',
113+
/**
114+
* @description Second part of the deprecation warning message.
115+
*/
116+
lowerDeprecationWarning:
117+
'The Controls and Third-Party cookie sections will be removed and the Privacy and Security panel will revert to its former name, the Security panel. As always, third-party cookies can be inspected from the Cookies pane in the Application panel.',
104118
} as const;
105119

106120
const str_ = i18n.i18n.registerUIStrings('panels/security/CookieControlsView.ts', UIStrings);
@@ -279,6 +293,25 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
279293
</devtools-button>
280294
</div>
281295
</div>
296+
<div class="deprecation-divider"></div>
297+
`;
298+
299+
const deprecationMessage = html`
300+
<div class="deprecation-warning">
301+
<div class="body">
302+
<devtools-icon
303+
name="warning"
304+
class="medium"
305+
style="color: var(--icon-warning); margin-right: var(--sys-size-2);">
306+
</devtools-icon>
307+
${i18nFormatString(UIStrings.upperDeprecationWarning, {
308+
PH1: UI.Fragment.html`<x-link class="devtools-link" href="https://privacysandbox.com/news/privacy-sandbox-update/" jslog=${VisualLogging.link('privacy-sandbox-update').track({click: true})}>${i18nString(UIStrings.blogPostLink)}</x-link>`,
309+
})}
310+
</div>
311+
<div class="body">
312+
${i18nString(UIStrings.lowerDeprecationWarning)}
313+
</div>
314+
</div>
282315
`;
283316

284317
render(html `
@@ -302,10 +335,11 @@ const DEFAULT_VIEW: View = (input: ViewInput, _output: object, target: HTMLEleme
302335
</div>
303336
</devtools-card>
304337
${Boolean(enterpriseEnabledSetting.get()) ? enterpriseDisclaimer : nothing}
338+
${deprecationMessage}
305339
</div>
306340
</div>
307341
`, target);
308-
// clang-format on
342+
// clang-format on
309343
};
310344

311345
export function showInfobar(): void {

front_end/panels/security/CookieReportView.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,24 @@ const UIStrings = {
169169
* @description String that shows up in the context menu when right clicking one of the entries in the cookie report.
170170
*/
171171
showRequestsWithThisCookie: 'Show requests with this cookie',
172+
/**
173+
* @description First part of the deprecation warning message.
174+
* @example {maintaining its current approach to user choice for third-party cookies} PH1
175+
*/
176+
upperDeprecationWarning: 'Chrome is {PH1} and third-party cookie exceptions are being phased out.',
177+
/**
178+
* @description Text for the blog post link inside the deprecation warning.
179+
*/
180+
blogPostLink: 'maintaining its current approach to user choice for third-party cookies',
181+
/**
182+
* @description Second part of the deprecation warning message.
183+
*/
184+
lowerDeprecationWarning:
185+
'The Controls and Third-Party cookie sections will be removed and the Privacy and Security panel will revert to its former name, the Security panel. As always, third-party cookies can be inspected from the Cookies pane in the Application panel.',
172186
} as const;
173187
const str_ = i18n.i18n.registerUIStrings('panels/security/CookieReportView.ts', UIStrings);
174188
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
189+
export const i18nFormatString = uiI18n.getFormatLocalizedString.bind(undefined, str_);
175190

176191
export interface ViewInput {
177192
cookieRows: IssuesManager.CookieIssue.CookieReportInfo[];
@@ -198,6 +213,27 @@ export interface CookieReportNodeData {
198213

199214
export type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
200215
const DEFAULT_VIEW: View = (input, output, target) => {
216+
const deprecationMessage = html`
217+
<div class="deprecation-warning">
218+
<div class="body">
219+
<devtools-icon
220+
name="warning"
221+
class="medium"
222+
style="color: var(--icon-warning); margin-right: var(--sys-size-2);">
223+
</devtools-icon>
224+
${i18nFormatString(UIStrings.upperDeprecationWarning, {
225+
PH1: UI.Fragment
226+
.html`<x-link class="devtools-link" href="https://privacysandbox.com/news/privacy-sandbox-update/" jslog=${
227+
VisualLogging.link('privacy-sandbox-update').track({click: true})}>${
228+
i18nString(UIStrings.blogPostLink)}</x-link>`,
229+
})}
230+
</div>
231+
<div class="body">
232+
${i18nString(UIStrings.lowerDeprecationWarning)}
233+
</div>
234+
</div>
235+
`;
236+
201237
// clang-format off
202238
render(html `
203239
<div class="report overflow-auto">
@@ -271,9 +307,12 @@ const DEFAULT_VIEW: View = (input, output, target) => {
271307
${i18nString(UIStrings.emptyReportExplanation)}
272308
</div>
273309
</div>
310+
<div class="deprecation-divider"></div>
274311
`
275312
}
276313
314+
${deprecationMessage}
315+
277316
</div>
278317
`, target);
279318
// clang-format on

front_end/panels/security/cookieControlsView.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,16 @@ input[type="checkbox"] {
124124
.subtext {
125125
color: var(--sys-color-on-surface-subtle);
126126
}
127+
128+
.deprecation-divider {
129+
border-bottom: 1px solid var(--sys-color-divider);
130+
margin: var(--sys-size-2) calc(var(--sys-size-3) * -1) var(--sys-size-6) calc(var(--sys-size-5) * -1);
131+
}
132+
133+
.deprecation-warning {
134+
padding: 0 var(--sys-size-5);
135+
}
136+
137+
.deprecation-warning > .body:first-child {
138+
margin-bottom: var(--sys-size-4);
139+
}

front_end/panels/security/cookieReportView.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,19 @@ devtools-data-grid {
7272
width: var(--sys-size-11);
7373
height: var(--sys-size-11);
7474
}
75+
76+
.deprecation-divider {
77+
border-bottom: 1px solid var(--sys-color-divider);
78+
margin-left: calc(var(--sys-size-5) * -1);
79+
margin-right: calc(var(--sys-size-3) * -1);
80+
margin-top: var(--sys-size-2);
81+
}
82+
83+
.deprecation-warning {
84+
padding: 0 var(--sys-size-5);
85+
margin-bottom: var(--sys-size-6);
86+
}
87+
88+
.deprecation-warning > .body:first-child {
89+
margin-bottom: var(--sys-size-4);
90+
}

front_end/ui/visual_logging/KnownContextValues.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2969,6 +2969,7 @@ export const knownContextValues = new Set([
29692969
'privacy-notice',
29702970
'privacy-policy',
29712971
'privacy-policy.console-insights',
2972+
'privacy-sandbox-update',
29722973
'private-state-tokens',
29732974
'production-origin',
29742975
'profile-loading-failed',

0 commit comments

Comments
 (0)