Commit 0221c879 authored by Kuo Jen Wei's avatar Kuo Jen Wei Committed by Commit Bot

[CCA] Use better selector for resolution items.

Use photo-item/video-item for item showing selected photo/video
resolution. Use title-item for title of external camera.

Test: tast run <DUT> 'camera.CCAUI*'
Bug: b/141518780
Change-Id: Ie4bb9eb89e5b6c1fc17b3b0bc2d9055227f52b89
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1905295
Commit-Queue: Kuo Jen Wei <inker@chromium.org>
Auto-Submit: Kuo Jen Wei <inker@chromium.org>
Reviewed-by: default avatarShik Chen <shik@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714843}
parent 88648d20
...@@ -437,8 +437,8 @@ cca.views.ResolutionSettings.prototype.updateResolutions_ = function() { ...@@ -437,8 +437,8 @@ cca.views.ResolutionSettings.prototype.updateResolutions_ = function() {
const prevFId = prevFocus && prevFocus.dataset.deviceId; const prevFId = prevFocus && prevFocus.dataset.deviceId;
const /** number */ focusIdx = const /** number */ focusIdx =
this.externalSettings_.findIndex(({deviceId}) => deviceId === prevFId); this.externalSettings_.findIndex(({deviceId}) => deviceId === prevFId);
const fTitle = /** @type {?HTMLElement} */ ( const fTitle = /** @type {?HTMLElement} */ (this.resMenu_.querySelector(
this.resMenu_.querySelector(`.menu-item[data-device-id="${prevFId}"]`)); `.external-camera.title-item[data-device-id="${prevFId}"]`));
/** @type {?string} */ /** @type {?string} */
const focusedId = focusIdx === -1 ? null : prevFId; const focusedId = focusIdx === -1 ? null : prevFId;
...@@ -515,8 +515,8 @@ cca.views.ResolutionSettings.prototype.updateSelectedPhotoResolution_ = ...@@ -515,8 +515,8 @@ cca.views.ResolutionSettings.prototype.updateSelectedPhotoResolution_ =
} else if (this.backsetting_ && this.backsetting_.deviceId === deviceId) { } else if (this.backsetting_ && this.backsetting_.deviceId === deviceId) {
photoItem = this.backPhotoItem_; photoItem = this.backPhotoItem_;
} else { } else {
photoItem = /** @type {!HTMLElement} */ (this.resMenu_.querySelectorAll( photoItem = /** @type {!HTMLElement} */ (this.resMenu_.querySelector(
`.menu-item[data-device-id="${deviceId}"]`)[1]); `.menu-item.photo-item[data-device-id="${deviceId}"]`));
} }
photoItem.querySelector('.description>span').textContent = photoItem.querySelector('.description>span').textContent =
this.photoOptTextTempl_(photo.prefResol, photo.resols); this.photoOptTextTempl_(photo.prefResol, photo.resols);
...@@ -549,8 +549,8 @@ cca.views.ResolutionSettings.prototype.updateSelectedVideoResolution_ = ...@@ -549,8 +549,8 @@ cca.views.ResolutionSettings.prototype.updateSelectedVideoResolution_ =
} else if (this.backSetting_ && this.backSetting_.deviceId === deviceId) { } else if (this.backSetting_ && this.backSetting_.deviceId === deviceId) {
videoItem = this.backVideoItem_; videoItem = this.backVideoItem_;
} else { } else {
videoItem = /** @type {!HTMLElement} */ (this.resMenu_.querySelectorAll( videoItem = /** @type {!HTMLElement} */ (this.resMenu_.querySelector(
`.menu-item[data-device-id="${deviceId}"]`)[1]); `.menu-item.video-item[data-device-id="${deviceId}"]`));
} }
videoItem.querySelector('.description>span').textContent = videoItem.querySelector('.description>span').textContent =
this.videoOptTextTempl_(video.prefResol); this.videoOptTextTempl_(video.prefResol);
......
...@@ -298,7 +298,7 @@ ...@@ -298,7 +298,7 @@
</div> </div>
<div id="builtin-photo-header" class="menu-item" <div id="builtin-photo-header" class="menu-item"
i18n-content="label_switch_take_photo_button"></div> i18n-content="label_switch_take_photo_button"></div>
<button class="menu-item resol-item" <button class="menu-item resol-item photo-item"
id="settings-front-photores" tabindex="0" id="settings-front-photores" tabindex="0"
aria-describedby="front-photores-desc"> aria-describedby="front-photores-desc">
<div> <div>
...@@ -310,7 +310,7 @@ ...@@ -310,7 +310,7 @@
</div> </div>
<div class="icon end"></div> <div class="icon end"></div>
</button> </button>
<button class="menu-item resol-item" <button class="menu-item resol-item photo-item"
id="settings-back-photores" tabindex="0" id="settings-back-photores" tabindex="0"
aria-describedby="back-photores-desc"> aria-describedby="back-photores-desc">
<div> <div>
...@@ -323,7 +323,7 @@ ...@@ -323,7 +323,7 @@
</button> </button>
<div id="builtin-video-header" class="menu-item" <div id="builtin-video-header" class="menu-item"
i18n-content="label_switch_record_video_button"></div> i18n-content="label_switch_record_video_button"></div>
<button class="menu-item resol-item" <button class="menu-item resol-item video-item"
id="settings-front-videores" tabindex="0" id="settings-front-videores" tabindex="0"
aria-describedby="front-videores-desc"> aria-describedby="front-videores-desc">
<div> <div>
...@@ -334,7 +334,7 @@ ...@@ -334,7 +334,7 @@
</div> </div>
<div class="icon end"></div> <div class="icon end"></div>
</button> </button>
<button class="menu-item resol-item" <button class="menu-item resol-item video-item"
id="settings-back-videores" tabindex="0" id="settings-back-videores" tabindex="0"
aria-describedby="back-videores-desc"> aria-describedby="back-videores-desc">
<div> <div>
...@@ -432,9 +432,9 @@ ...@@ -432,9 +432,9 @@
</label> </label>
</template> </template>
<template id="extcam-resolution-item-template"> <template id="extcam-resolution-item-template">
<div class="menu-item external-camera" <div class="menu-item external-camera title-item"
i18n-content="label_external_camera"></div> i18n-content="label_external_camera"></div>
<button class="menu-item resol-item external-camera" <button class="menu-item external-camera resol-item photo-item"
tabindex="0"> tabindex="0">
<div> <div>
<div i18n-content="photo_resolution_button"></div> <div i18n-content="photo_resolution_button"></div>
...@@ -444,7 +444,7 @@ ...@@ -444,7 +444,7 @@
</div> </div>
<div class="icon end"></div> <div class="icon end"></div>
</button> </button>
<button class="menu-item resol-item external-camera" <button class="menu-item external-camera resol-item video-item"
tabindex="0"> tabindex="0">
<div> <div>
<div i18n-content="video_resolution_button"></div> <div i18n-content="video_resolution_button"></div>
......
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