Commit 3c1923fb authored by Michael Hansen's avatar Michael Hansen Committed by Commit Bot

[Nearby] Clean up iron-list remnants on device visibility page.

In a recent CL (crrev.com/c/2548454) we switched from iron-list to
dom-repeat for displaying the list of contacts on the device visibility
page. This cleans up some remaining references and support for
iron-list.

Bug: b:168841167
Change-Id: If112c4f134dab370a08d8911aa45e090e4272ca0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2560933Reviewed-by: default avatarJames Vecore <vecore@google.com>
Commit-Queue: Michael Hansen <hansenmichael@google.com>
Cr-Commit-Position: refs/heads/master@{#831149}
parent e03565a0
...@@ -100,7 +100,6 @@ js_library("nearby_contact_visibility") { ...@@ -100,7 +100,6 @@ js_library("nearby_contact_visibility") {
":nearby_contact_manager", ":nearby_contact_manager",
":nearby_share_settings_behavior", ":nearby_share_settings_behavior",
"//third_party/polymer/v1_0/components-chromium/iron-icon:iron-icon-extracted", "//third_party/polymer/v1_0/components-chromium/iron-icon:iron-icon-extracted",
"//third_party/polymer/v1_0/components-chromium/iron-list:iron-list-extracted",
"//ui/webui/resources/cr_elements/cr_radio_button:cr_card_radio_button", "//ui/webui/resources/cr_elements/cr_radio_button:cr_card_radio_button",
"//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group", "//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group",
"//ui/webui/resources/js:assert", "//ui/webui/resources/js:assert",
...@@ -193,7 +192,6 @@ js_library("nearby_contact_visibility.m") { ...@@ -193,7 +192,6 @@ js_library("nearby_contact_visibility.m") {
deps = [ deps = [
":nearby_contact_manager.m", ":nearby_contact_manager.m",
":nearby_share_settings_behavior.m", ":nearby_share_settings_behavior.m",
"//third_party/polymer/v3_0/components-chromium/iron-list:iron-list",
"//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled",
"//ui/webui/resources/cr_elements/cr_radio_button:cr_card_radio_button.m", "//ui/webui/resources/cr_elements/cr_radio_button:cr_card_radio_button.m",
"//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group.m", "//ui/webui/resources/cr_elements/cr_radio_group:cr_radio_group.m",
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<link rel="import" href="chrome://resources/html/i18n_behavior.html"> <link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/load_time_data.html"> <link rel="import" href="chrome://resources/html/load_time_data.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
<link rel="import" href="chrome://resources/polymer/v1_0/iron-list/iron-list.html">
<link rel="import" href="nearby_contact_manager.html"> <link rel="import" href="nearby_contact_manager.html">
<link rel="import" href="nearby_page_template.html"> <link rel="import" href="nearby_page_template.html">
<link rel="import" href="nearby_share_settings_behavior.html"> <link rel="import" href="nearby_share_settings_behavior.html">
......
...@@ -143,26 +143,8 @@ Polymer({ ...@@ -143,26 +143,8 @@ Polymer({
'selectedVisibilityChanged_(selectedVisibility)', 'selectedVisibilityChanged_(selectedVisibility)',
], ],
/** @type {ResizeObserver} used to observer size changes to this element */
resizeObserver_: null,
/** @override */ /** @override */
attached() { attached() {
// This is a required work around to get the iron-list to display on first
// view. Currently iron-list won't generate item elements on attach if the
// element is not visible. Because we are hosted in a cr-view-manager for
// on-boarding, this component is not visible when the items are bound. To
// fix this issue, we listen for resize events (which happen when display is
// switched from none to block by the view manager) and manually call
// notifyResize on the iron-list
this.resizeObserver_ = new ResizeObserver(entries => {
const contactList =
/** @type {IronListElement} */ (this.$$('#contactList'));
if (contactList) {
contactList.notifyResize();
}
});
this.resizeObserver_.observe(this);
this.contactManager_ = nearby_share.getContactManager(); this.contactManager_ = nearby_share.getContactManager();
this.downloadContactsObserverReceiver_ = nearby_share.observeContactManager( this.downloadContactsObserverReceiver_ = nearby_share.observeContactManager(
/** @type {!nearbyShare.mojom.DownloadContactsObserverInterface} */ ( /** @type {!nearbyShare.mojom.DownloadContactsObserverInterface} */ (
...@@ -174,8 +156,6 @@ Polymer({ ...@@ -174,8 +156,6 @@ Polymer({
/** @override */ /** @override */
detached() { detached() {
this.resizeObserver_.disconnect();
if (this.downloadContactsObserverReceiver_) { if (this.downloadContactsObserverReceiver_) {
this.downloadContactsObserverReceiver_.$.close(); this.downloadContactsObserverReceiver_.$.close();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment