-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NTP][Panorama] Add Chrome Colors page and fill it with data
This does not include any layout or styling. This CL adds navigation to the chrome colors page and grabs the color data. The chrome colors themes page shows the full list of kGeneratedColorsInfo, rather than the partial list that shows on the Overview page. Therefore, I renamed the current function to GetPartialChromeColors and made a new function GetChromeColors for use in theme selection. I originally wanted to reuse the colors component and have it conditionally shown on the themes page, but the code was getting a lot more complicated with that approach. Also, a lot of the functionality of the colors component is not needed in the Chrome Colors collection. Screenshot: screenshot/7iMkcsqBeN7hQ6F Bug: 1384250 Change-Id: I9eaeaf80169ff88263c755d40b52e55a1d4d7673 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4177788 Reviewed-by: Emily Stark <estark@chromium.org> Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org> Commit-Queue: Riley Tatum <rtatum@google.com> Cr-Commit-Position: refs/heads/main@{#1095773}
- Loading branch information
Riley Tatum
authored and
Chromium LUCI CQ
committed
Jan 23, 2023
1 parent
692cc5e
commit 8a30271
Showing
20 changed files
with
266 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
chrome/browser/resources/side_panel/customize_chrome/chrome_colors.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<button on-click="onBackClick_" id="backButton" | ||
title="$i18n{backButton}"> | ||
Go Back | ||
</button> | ||
<h1>$i18n{chromeColors}</h1> | ||
<template id="chromeColors" is="dom-repeat" items="[[colors_]]"> | ||
<p class="color">[[item.name]]</p> | ||
</template> |
55 changes: 55 additions & 0 deletions
55
chrome/browser/resources/side_panel/customize_chrome/chrome_colors.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2023 The Chromium Authors | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
import './color.js'; | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {getTemplate} from './chrome_colors.html.js'; | ||
import {ChromeColor} from './customize_chrome.mojom-webui.js'; | ||
import {CustomizeChromeApiProxy} from './customize_chrome_api_proxy.js'; | ||
|
||
export interface ChromeColorsElement { | ||
$: { | ||
backButton: HTMLElement, | ||
}; | ||
} | ||
|
||
export class ChromeColorsElement extends PolymerElement { | ||
static get is() { | ||
return 'customize-chrome-chrome-colors'; | ||
} | ||
|
||
static get template() { | ||
return getTemplate(); | ||
} | ||
|
||
static get properties() { | ||
return { | ||
colors_: Array, | ||
}; | ||
} | ||
|
||
private colors_: ChromeColor[]; | ||
|
||
constructor() { | ||
super(); | ||
CustomizeChromeApiProxy.getInstance().handler.getChromeColors().then( | ||
({colors}) => { | ||
this.colors_ = colors; | ||
}); | ||
} | ||
|
||
private onBackClick_() { | ||
this.dispatchEvent(new Event('back-click')); | ||
} | ||
} | ||
|
||
declare global { | ||
interface HTMLElementTagNameMap { | ||
'customize-chrome-chrome-colors': ChromeColorsElement; | ||
} | ||
} | ||
|
||
customElements.define(ChromeColorsElement.is, ChromeColorsElement); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.