-
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.
[Fast Pair] Add forget bluetooth device dialog
Add a dialog for the user to confirm that they want to forget a bluetooth device. Change-Id: I4a42514a56ae7616fa7e8513979cff629b1c2844 Fixed: b/238808809 Tested: Manually tested and updated unit tests Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3756863 Reviewed-by: Jimmy Gong <jimmyxgong@chromium.org> Reviewed-by: Juliet Lévesque <julietlevesque@google.com> Commit-Queue: Alex Kingsborough <akingsb@google.com> Cr-Commit-Position: refs/heads/main@{#1028576}
- Loading branch information
Alex Kingsborough
authored and
Chromium LUCI CQ
committed
Jul 27, 2022
1 parent
2c9c30a
commit 8d58a31
Showing
14 changed files
with
189 additions
and
11 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
1 change: 1 addition & 0 deletions
1
chrome/app/os_settings_strings_grdp/IDS_SETTINGS_FORGET_DEVICE_DIALOG_CANCEL.png.sha1
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 @@ | ||
969c3368b8521354024d12604361539d80c83fc5 |
1 change: 1 addition & 0 deletions
1
chrome/app/os_settings_strings_grdp/IDS_SETTINGS_FORGET_DEVICE_DIALOG_FORGET.png.sha1
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 @@ | ||
969c3368b8521354024d12604361539d80c83fc5 |
1 change: 1 addition & 0 deletions
1
chrome/app/os_settings_strings_grdp/IDS_SETTINGS_FORGET_DEVICE_DIALOG_LABEL.png.sha1
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 @@ | ||
1b88c0708fce8891f89d94201891dc924dd3feaf |
1 change: 1 addition & 0 deletions
1
chrome/app/os_settings_strings_grdp/IDS_SETTINGS_FORGET_DEVICE_DIALOG_TITLE.png.sha1
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 @@ | ||
969c3368b8521354024d12604361539d80c83fc5 |
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
30 changes: 30 additions & 0 deletions
30
...wser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_forget_device_dialog.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,30 @@ | ||
<style include="settings-shared"> | ||
:host { | ||
--cr-dialog-width: 320px; | ||
} | ||
[slot='button-container'] { | ||
display: flex; | ||
justify-content: flex-end; | ||
margin: 40px 0 20px 0; | ||
padding-bottom: 0; | ||
padding-top: 0; | ||
} | ||
</style> | ||
<cr-dialog id="dialog" show-on-attach> | ||
<div id="title" slot="title"> | ||
$i18n{bluetoothDevicesDialogTitle} | ||
</div> | ||
<div slot="body"> | ||
[[getForgetDeviceDialogBodyText_()]] | ||
</div> | ||
<div slot="button-container"> | ||
<cr-button id="cancel" class="cancel-button" | ||
on-click="onCancelClick_"> | ||
$i18n{bluetoothDevicesDialogCancel} | ||
</cr-button> | ||
<cr-button id="forget" class="action-button" | ||
on-click="onForgetTap_"> | ||
$i18n{bluetoothDevicesDialogForget} | ||
</cr-button> | ||
</div> | ||
</cr-dialog> |
81 changes: 81 additions & 0 deletions
81
...rowser/resources/settings/chromeos/os_bluetooth_page/os_bluetooth_forget_device_dialog.js
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,81 @@ | ||
// Copyright 2022 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. | ||
|
||
/** | ||
* @fileoverview | ||
* Forget dialog is used to forget a Bluetooth device. | ||
*/ | ||
import '../../settings_shared.css.js'; | ||
import 'chrome://resources/cr_elements/cr_input/cr_input.m.js'; | ||
|
||
import {getDeviceName} from 'chrome://resources/cr_components/chromeos/bluetooth/bluetooth_utils.js'; | ||
import {I18nBehavior, I18nBehaviorInterface} from 'chrome://resources/js/i18n_behavior.m.js'; | ||
import {PairedBluetoothDeviceProperties} from 'chrome://resources/mojo/chromeos/services/bluetooth_config/public/mojom/cros_bluetooth_config.mojom-webui.js'; | ||
import {html, mixinBehaviors, PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; | ||
|
||
import {loadTimeData} from '../../i18n_setup.js'; | ||
|
||
/** | ||
* @constructor | ||
* @extends {PolymerElement} | ||
* @implements {I18nBehaviorInterface} | ||
*/ | ||
const SettingsBluetoothForgetDeviceDialogElementBase = | ||
mixinBehaviors([I18nBehavior], PolymerElement); | ||
/** @polymer */ | ||
class SettingsBluetoothForgetDeviceDialogElement extends | ||
SettingsBluetoothForgetDeviceDialogElementBase { | ||
static get is() { | ||
return 'os-settings-bluetooth-forget-device-dialog'; | ||
} | ||
static get template() { | ||
return html`{__html_template__}`; | ||
} | ||
static get properties() { | ||
return { | ||
/** | ||
* @private {!PairedBluetoothDeviceProperties} | ||
*/ | ||
device_: { | ||
type: Object, | ||
}, | ||
}; | ||
} | ||
/** | ||
* @private | ||
*/ | ||
getForgetDeviceDialogBodyText_() { | ||
return this.i18n( | ||
'bluetoothDevicesDialogLabel', this.getDeviceName_(), | ||
loadTimeData.getString('primaryUserEmail')); | ||
} | ||
|
||
/** | ||
* @return {string} | ||
* @private | ||
*/ | ||
getDeviceName_() { | ||
return getDeviceName(this.device_); | ||
} | ||
|
||
/** | ||
* @param {!Event} event | ||
* @private | ||
*/ | ||
onForgetTap_(event) { | ||
const fireEvent = new CustomEvent( | ||
'forget-bluetooth-device', {bubbles: true, composed: true}); | ||
this.dispatchEvent(fireEvent); | ||
this.$.dialog.close(); | ||
event.stopPropagation(); | ||
} | ||
|
||
/** @private */ | ||
onCancelClick_(event) { | ||
this.$.dialog.close(); | ||
} | ||
} | ||
customElements.define( | ||
SettingsBluetoothForgetDeviceDialogElement.is, | ||
SettingsBluetoothForgetDeviceDialogElement); |
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