Bug 1944416: Restore individual tabs from closed groups in closed windows r=dao,sessi...
[gecko.git] / browser / components / firefoxview / recentbrowsing.mjs
blob78d31324024ea9d65c96527cba2194b474f275a9
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2  * License, v. 2.0. If a copy of the MPL was not distributed with this
3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 import { html } from "chrome://global/content/vendor/lit.all.mjs";
6 import { ViewPage } from "./viewpage.mjs";
8 class RecentBrowsingInView extends ViewPage {
9   constructor() {
10     super();
11     this.pageType = "recentbrowsing";
12   }
14   static queries = {
15     searchTextbox: "fxview-search-textbox",
16   };
18   static properties = {
19     ...ViewPage.properties,
20   };
22   viewVisibleCallback() {
23     for (let child of this.children) {
24       let childView = child.firstElementChild;
25       childView.paused = false;
26       childView.viewVisibleCallback();
27     }
28   }
30   viewHiddenCallback() {
31     for (let child of this.children) {
32       let childView = child.firstElementChild;
33       childView.paused = true;
34       childView.viewHiddenCallback();
35     }
36   }
38   render() {
39     return html`
40       <link
41         rel="stylesheet"
42         href="chrome://browser/content/firefoxview/firefoxview.css"
43       />
44       <div class="sticky-container bottom-fade">
45         <h2 class="page-header" data-l10n-id="firefoxview-overview-header"></h2>
46         <div class="search-container">
47           <fxview-search-textbox
48             data-l10n-id="firefoxview-search-text-box-recentbrowsing"
49             data-l10n-attrs="placeholder"
50             .size=${this.searchTextboxSize}
51             pageName="recentbrowsing"
52           ></fxview-search-textbox>
53         </div>
54       </div>
55       <div class="cards-container">
56         <slot></slot>
57       </div>
58     `;
59   }
61 customElements.define("view-recentbrowsing", RecentBrowsingInView);