Skip to content

Commit

Permalink
[memories] Removes chrome://memories
Browse files Browse the repository at this point in the history
With crrev.com/c/3046546, <history-clusters> previously hosted under
chrome://memories is now hosted under chrome://history/journeys. This
change moves the necessary resources from //c/b/r/memories to
//c/b/r/history/history_clusters and deletes the rest along with the
code related to chrome://memories

Fixed: 1229397
Change-Id: I1fa6632e974a4a5108da923f1209518d4423798a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3058392
Commit-Queue: Moe Ahmadi <mahmadi@chromium.org>
Reviewed-by: dpapad <dpapad@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: Alex Gough <ajgo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#906553}
  • Loading branch information
Moe Ahmadi authored and Chromium LUCI CQ committed Jul 29, 2021
1 parent 8c6bf27 commit 04d8997
Show file tree
Hide file tree
Showing 43 changed files with 60 additions and 368 deletions.
3 changes: 1 addition & 2 deletions chrome/browser/chrome_browser_interface_binders.cc
Expand Up @@ -136,7 +136,6 @@
#include "chrome/browser/ui/webui/download_shelf/download_shelf.mojom.h"
#include "chrome/browser/ui/webui/download_shelf/download_shelf_ui.h"
#include "chrome/browser/ui/webui/history_clusters/history_clusters.mojom.h"
#include "chrome/browser/ui/webui/history_clusters/memories_ui.h"
#include "chrome/browser/ui/webui/internals/user_education/user_education_internals.mojom.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page.mojom.h"
#include "chrome/browser/ui/webui/new_tab_page/new_tab_page_ui.h"
Expand Down Expand Up @@ -692,7 +691,7 @@ void PopulateChromeWebUIFrameBinders(

if (base::FeatureList::IsEnabled(history_clusters::kMemories)) {
RegisterWebUIControllerInterfaceBinder<history_clusters::mojom::PageHandler,
HistoryUI, MemoriesUI>(map);
HistoryUI>(map);
}

RegisterWebUIControllerInterfaceBinder<
Expand Down
4 changes: 2 additions & 2 deletions chrome/browser/flag_descriptions.cc
Expand Up @@ -1588,11 +1588,11 @@ const char kMediaSessionWebRTCDescription[] =
"Adds new actions into Media Session for video conferencing.";

const char kMemoriesName[] = "Memories";
const char kMemoriesDescription[] = "Enables chrome://memories.";
const char kMemoriesDescription[] = "Enables chrome://history/journeys.";

const char kMemoriesDebugName[] = "Memories Debug";
const char kMemoriesDebugDescription[] =
"Show debug information for chrome://memories.";
"Shows visit metadata in chrome://history to debug history clustering.";

const char kMetricsSettingsAndroidName[] = "Metrics Settings on Android";
const char kMetricsSettingsAndroidDescription[] =
Expand Down
1 change: 0 additions & 1 deletion chrome/browser/resources/BUILD.gn
Expand Up @@ -35,7 +35,6 @@ group("resources") {
"gaia_auth_host:resources",
"history:resources",
"management:resources",
"memories:resources",
"new_tab_page:resources",
"new_tab_page_instant:resources",
"new_tab_page_third_party:resources",
Expand Down
55 changes: 26 additions & 29 deletions chrome/browser/resources/history/BUILD.gn
Expand Up @@ -70,6 +70,7 @@ preprocess_if_expr("preprocess") {
"browser_service.ts",
"constants.ts",
"externs.ts",
"history_clusters/browser_proxy.ts",
"history.ts",
"lazy_load.ts",
"query_manager.ts",
Expand All @@ -83,6 +84,14 @@ preprocess_if_expr("preprocess_generated") {
out_folder = "$target_gen_dir/$preprocess_folder"
in_files = [
"app.ts",
"history_clusters/cluster.ts",
"history_clusters/clusters.ts",
"history_clusters/page_favicon.ts",
"history_clusters/search_query.ts",
"history_clusters/shared_style.ts",
"history_clusters/shared_vars.ts",
"history_clusters/top_visit.ts",
"history_clusters/url_visit.ts",
"history_item.ts",
"history_list.ts",
"history_toolbar.ts",
Expand Down Expand Up @@ -112,7 +121,7 @@ grit("resources") {
output_dir = "$root_gen_dir/chrome"
}

html_to_js("web_components") {
html_to_js("web_components_local") {
js_files = [
"app.ts",
"history_item.ts",
Expand All @@ -127,6 +136,13 @@ html_to_js("web_components") {
]
}

group("web_components") {
public_deps = [
":web_components_local",
"history_clusters:web_components",
]
}

ts_library("build_ts") {
root_dir = "$target_gen_dir/$preprocess_folder"
out_dir = "$target_gen_dir/tsc"
Expand All @@ -136,16 +152,16 @@ ts_library("build_ts") {
"browser_service.ts",
"constants.ts",
"externs.ts",
"history_clusters/browser_proxy.js",
"history_clusters/cluster.js",
"history_clusters/clusters.js",
"history_clusters/browser_proxy.ts",
"history_clusters/cluster.ts",
"history_clusters/clusters.ts",
"history_clusters/history_clusters.mojom-webui.js",
"history_clusters/page_favicon.js",
"history_clusters/search_query.js",
"history_clusters/shared_style.js",
"history_clusters/shared_vars.js",
"history_clusters/top_visit.js",
"history_clusters/visit_row.js",
"history_clusters/page_favicon.ts",
"history_clusters/search_query.ts",
"history_clusters/shared_style.ts",
"history_clusters/shared_vars.ts",
"history_clusters/top_visit.ts",
"history_clusters/url_visit.ts",
"history_item.ts",
"history_list.ts",
"history_toolbar.ts",
Expand All @@ -166,31 +182,12 @@ ts_library("build_ts") {
]
definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
extra_deps = [
":copy_history_clusters",
":copy_history_clusters_mojom",
":preprocess",
":preprocess_generated",
]
}

copy("copy_history_clusters") {
sources = [
"$target_gen_dir/../memories/tsc/browser_proxy.js",
"$target_gen_dir/../memories/tsc/cluster.js",
"$target_gen_dir/../memories/tsc/clusters.js",
"$target_gen_dir/../memories/tsc/page_favicon.js",
"$target_gen_dir/../memories/tsc/search_query.js",
"$target_gen_dir/../memories/tsc/shared_style.js",
"$target_gen_dir/../memories/tsc/shared_vars.js",
"$target_gen_dir/../memories/tsc/top_visit.js",
"$target_gen_dir/../memories/tsc/visit_row.js",
]
outputs = [
"$target_gen_dir/$preprocess_folder/history_clusters/{{source_file_part}}",
]
deps = [ "//chrome/browser/resources/memories:build_ts" ]
}

copy("copy_history_clusters_mojom") {
sources = [ "$root_gen_dir/mojom-webui/chrome/browser/ui/webui/history_clusters/history_clusters.mojom-webui.js" ]
outputs = [
Expand Down
18 changes: 18 additions & 0 deletions chrome/browser/resources/history/history_clusters/BUILD.gn
@@ -0,0 +1,18 @@
# Copyright 2021 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//tools/polymer/html_to_js.gni")

html_to_js("web_components") {
js_files = [
"cluster.ts",
"clusters.ts",
"page_favicon.ts",
"search_query.ts",
"shared_style.ts",
"shared_vars.ts",
"top_visit.ts",
"url_visit.ts",
]
}
@@ -1 +1,2 @@
mahmadi@chromium.org
file://components/history_clusters/OWNERS
Expand Up @@ -150,12 +150,12 @@ class HistoryClustersElement extends PolymerElement {
}

/**
* Called with `event` received from a cluster that should be removed or
* Called when an event is received from a cluster that should be removed or
* restructured due to all its visits or its top visit having been removed.
* Contains the id of the Cluster in question.
* @private
*/
private onClusterChangedOrRemoved_(event: CustomEvent<bigint>) {
private onClusterChangedOrRemoved_() {
// Request up to as many of the freshest clusters as currently shown until
// now.
this.onBrowserIdle_().then(() => {
Expand Down
Expand Up @@ -91,17 +91,17 @@
transform: rotate(180deg);
}
</style>
<visit-row is-top-visit visit="[[visit]]"></visit-row>
<url-visit is-top-visit visit="[[visit]]"></url-visit>
<div id="related-content">
<div id="related-visits">
<template is="dom-repeat" items="[[visibleRelatedVisits_]]">
<visit-row visit="[[item]]"></visit-row>
<url-visit visit="[[item]]"></url-visit>
</template>
<!-- Disable animation on iron-collapse, as the parent iron-list can't
easily handle it. -->
<iron-collapse opened="[[expanded_]]" no-animation>
<template is="dom-repeat" items="[[hiddenRelatedVisits_]]">
<visit-row visit="[[item]]"></visit-row>
<url-visit visit="[[item]]"></url-visit>
</template>
</iron-collapse>
</div>
Expand Down
Expand Up @@ -4,7 +4,7 @@

import './search_query.js';
import './shared_style.js';
import './visit_row.js';
import './url_visit.js';
import 'chrome://resources/cr_elements/cr_icons_css.m.js';
import 'chrome://resources/polymer/v3_0/iron-collapse/iron-collapse.js';

Expand Down
Expand Up @@ -31,7 +31,7 @@ const annotationToStringId: Map<number, string> = new Map([

declare global {
interface HTMLElementTagNameMap {
'visit-row': VisitRowElement;
'url-visit': VisitRowElement;
}
}

Expand All @@ -44,7 +44,7 @@ interface VisitRowElement {

class VisitRowElement extends PolymerElement {
static get is() {
return 'visit-row';
return 'url-visit';
}

static get template() {
Expand Down
11 changes: 0 additions & 11 deletions chrome/browser/resources/memories/.eslintrc.js

This file was deleted.

20 changes: 0 additions & 20 deletions chrome/browser/resources/memories/app.html

This file was deleted.

96 changes: 0 additions & 96 deletions chrome/browser/resources/memories/app.ts

This file was deleted.

31 changes: 0 additions & 31 deletions chrome/browser/resources/memories/history_clusters.html

This file was deleted.

5 changes: 0 additions & 5 deletions chrome/browser/resources/memories/history_clusters.ts

This file was deleted.

3 changes: 0 additions & 3 deletions chrome/browser/resources/memories/router.html

This file was deleted.

0 comments on commit 04d8997

Please sign in to comment.