Skip to content

Commit

Permalink
CCA: Hide PTZ button into expert mode
Browse files Browse the repository at this point in the history
Bug: b/185196105
Test: Manually see if the PTZ button only shown when expert mode options
are on.

Change-Id: I9fb28454639291ce93a6795579c5eae1397bee8d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2822584
Commit-Queue: Inker Kuo <inker@chromium.org>
Auto-Submit: Inker Kuo <inker@chromium.org>
Reviewed-by: Shik Chen <shik@chromium.org>
Cr-Commit-Position: refs/branch-heads/4472@{#53}
Cr-Branched-From: 3d60439-refs/heads/master@{#870763}
  • Loading branch information
Kuo Jen Wei authored and Chromium LUCI CQ committed Apr 14, 2021
1 parent 1116daf commit 74758f6
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions chromeos/components/camera_app_ui/resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const struct {
{"expert_save_metadata", IDS_EXPERT_SAVE_METADATA},
{"expert_print_performance_logs", IDS_EXPERT_PRINT_PERFORMANCE_LOGS},
{"expert_scan_barcode", IDS_EXPERT_SCAN_BARCODE},
{"expert_show_ptz_options", IDS_EXPERT_SHOW_PTZ_OPTIONS},
{"expert_custom_video_parameters", IDS_EXPERT_CUSTOM_VIDEO_PARAMETERS},
{"tilt_up_button", IDS_TILT_UP_BUTTON},
{"pan_right_button", IDS_PAN_RIGHT_BUTTON},
Expand Down
2 changes: 1 addition & 1 deletion chromeos/components/camera_app_ui/resources/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,7 @@ body.max-wnd #options-group {
margin: var(--option-item-vpadding) 0;
}

body:not(.has-ptz-support) #open-ptz-panel {
body:is(:not(.has-ptz-support), :not(.expert), :not(.show-ptz-options)) #open-ptz-panel {
display: none;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
background-color: rgb(26, 115, 232);
border-radius: 20px;
color: white;
display: flex;
display: none;
height: 42px;
padding: 0 12px;
position: absolute;
Expand Down
1 change: 1 addition & 0 deletions chromeos/components/camera_app_ui/resources/js/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export const State = {
SCAN_BARCODE: 'scan-barcode',
SHOULD_HANDLE_INTENT_RESULT: 'should-handle-intent-result',
SHOW_METADATA: 'show-metadata',
SHOW_PTZ_OPTIONS: 'show-ptz-options',
SCREEN_OFF_AUTO: 'screen-off-auto',
STREAMING: 'streaming',
SUSPEND: 'suspend',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,14 +363,17 @@ export class Camera extends View {
}

/**
* @suppress {uselessCode} For skip highlighting PTZ button code.
* @private
*/
initOpenPTZPanel_() {
this.openPTZPanel_.addEventListener('click', () => {
nav.open(ViewName.PTZ_PANEL, this.preview_.stream);
highlight(false);
});

// Skip highlight effect on R91 release.
return;
/* eslint-disable no-unreachable */
// Highlight effect for PTZ button.
const highlight = (enabled) => {
this.ptzToast_.classList.toggle('hidden', !enabled);
Expand Down Expand Up @@ -399,6 +402,7 @@ export class Camera extends View {
this.ptzToast_.style.left = `${right + 20}px`;
highlight(true);
});
/* eslint-enabled no-unreachable */
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@
<message desc="Label for snackbar message when a link is copied" name="IDS_SNACKBAR_TEXT_COPIED">
Text copied
</message>
<message desc="Label for expert mode option: show camera pan/tilt/zoom options." name="IDS_EXPERT_SHOW_PTZ_OPTIONS">
Show pan tilt zoom options
</message>
<message desc="Label for tilt up camera preview" name="IDS_TILT_UP_BUTTON">
Tilt up
</message>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0b8a9fa99e9ae409882295f1ff4894be5d5fd02d
7 changes: 7 additions & 0 deletions chromeos/components/camera_app_ui/resources/views/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,13 @@
data-key="printPerformanceLogs">
<span i18n-text="expert_print_performance_logs"></span>
</label>
<label class="menu-item">
<input class="icon" id="expert-show-ptz-options"
type="checkbox" tabindex="0"
data-state="show-ptz-options"
data-key="showPtzOptions">
<span i18n-text="expert_show_ptz_options"></span>
</label>
<label class="menu-item">
<input class="icon" id="custom-video-parameters"
type="checkbox" tabindex="0"
Expand Down

0 comments on commit 74758f6

Please sign in to comment.