Commit e7fc11e9 authored by David Reveman's avatar David Reveman Committed by Commit Bot

Change Picture: Change take photo label when in video mode.

Camera: Take photo.
Video: Capture video.

Bug: 787673
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ie9f3a72991b6384533b6d5d031ab4e11ecf2e1b2
Reviewed-on: https://chromium-review.googlesource.com/804560Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Commit-Queue: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521436}
parent f9eaa531
......@@ -2280,6 +2280,9 @@
<message name="IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO" desc="The text on the button to take photo of the current user.">
Take photo
</message>
<message name="IDS_OPTIONS_CHANGE_PICTURE_CAPTURE_VIDEO" desc="The text on the button to capture video of the current user.">
Capture video
</message>
<message name="IDS_OPTIONS_CHANGE_PICTURE_PHOTO_FROM_CAMERA" desc="The accessible text on the icon in the user image grid for a camera photo, when a photo has been captured.">
Photo from internal camera
</message>
......
......@@ -2975,6 +2975,9 @@
<message name="IDS_SETTINGS_CHANGE_PICTURE_TAKE_PHOTO" desc="The text on the button to take photo of the current user.">
Take photo
</message>
<message name="IDS_SETTINGS_CHANGE_PICTURE_CAPTURE_VIDEO" desc="The text on the button to capture video of the current user.">
Capture video
</message>
<message name="IDS_SETTINGS_CHANGE_PICTURE_DISCARD_PHOTO" desc="The text on the button to discard the captured photo of the current user.">
Discard photo
</message>
......
......@@ -49,6 +49,7 @@
image-type="[[getImageType_(selectedItem_)]]"
discard-image-label="[[i18nDynamic(locale, 'discardPhoto')]]"
take-photo-label="[[i18nDynamic(locale, 'takePhoto')]]"
capture-video-label="[[i18nDynamic(locale, 'captureVideo')]]"
switch-mode-to-camera-label="[[i18nDynamic(locale,
'switchModeToCamera')]]"
switch-mode-to-video-label="[[i18nDynamic(locale,
......@@ -62,7 +63,8 @@
selected-item="{{selectedItem_}}"
old-image-label="[[i18nDynamic(locale, 'photoFromCamera')]]"
profile-image-label="[[i18nDynamic(locale, 'profilePhoto')]]"
take-photo-label="[[i18nDynamic(locale, 'takePhoto')]]">
take-photo-label="[[i18nDynamic(locale, 'takePhoto')]]"
capture-video-label="[[i18nDynamic(locale, 'captureVideo')]]">
</cr-picture-list>
</div>
</template>
......
......@@ -84,6 +84,7 @@
discard-image-label="$i18n{discardPhoto}"
preview-alt-text="$i18n{previewAltText}"
take-photo-label="$i18n{takePhoto}"
capture-video-label="$i18n{captureVideo}"
switch-mode-to-camera-label="$i18n{switchModeToCamera}"
switch-mode-to-video-label="$i18n{switchModeToVideo}"
camera-video-mode-enabled="[[cameraVideoModeEnabled_]]">
......@@ -106,6 +107,7 @@
old-image-label="$i18n{oldPhoto}"
profile-image-label="$i18n{profilePhoto}"
take-photo-label="$i18n{takePhoto}">
capture-video-label="$i18n{captureVideo}">
</cr-picture-list>
</div>
</template>
......
......@@ -93,6 +93,7 @@ void UserImageScreenHandler::DeclareLocalizedValues(
builder->Add("userImageScreenDescription",
IDS_USER_IMAGE_SCREEN_DESCRIPTION);
builder->Add("takePhoto", IDS_OPTIONS_CHANGE_PICTURE_TAKE_PHOTO);
builder->Add("captureVideo", IDS_OPTIONS_CHANGE_PICTURE_CAPTURE_VIDEO);
builder->Add("discardPhoto", IDS_OPTIONS_CHANGE_PICTURE_DISCARD_PHOTO);
builder->Add("switchModeToCamera",
IDS_OPTIONS_CHANGE_PICTURE_SWITCH_MODE_TO_CAMERA);
......
......@@ -1356,6 +1356,7 @@ void AddPeopleStrings(content::WebUIDataSource* html_source) {
{"changePictureTitle", IDS_SETTINGS_CHANGE_PICTURE_DIALOG_TITLE},
{"changePicturePageDescription", IDS_SETTINGS_CHANGE_PICTURE_DIALOG_TEXT},
{"takePhoto", IDS_SETTINGS_CHANGE_PICTURE_TAKE_PHOTO},
{"captureVideo", IDS_SETTINGS_CHANGE_PICTURE_CAPTURE_VIDEO},
{"discardPhoto", IDS_SETTINGS_CHANGE_PICTURE_DISCARD_PHOTO},
{"switchModeToCamera", IDS_SETTINGS_CHANGE_PICTURE_SWITCH_MODE_TO_CAMERA},
{"switchModeToVideo", IDS_SETTINGS_CHANGE_PICTURE_SWITCH_MODE_TO_VIDEO},
......
......@@ -144,7 +144,8 @@
</div>
<div>
<button is="paper-icon-button-light" id="takePhoto" tabindex="1"
title="[[takePhotoLabel]]" on-tap="takePhoto"
title="[[getTakePhotoLabel_(videomode, takePhotoLabel,
captureVideoLabel)]]" on-tap="takePhoto"
disabled="[[!cameraOnline_]]">
</button>
</div>
......
......@@ -35,6 +35,7 @@ Polymer({
properties: {
/** Strings provided by host */
takePhotoLabel: String,
captureVideoLabel: String,
switchModeToCameraLabel: String,
switchModeToVideoLabel: String,
......@@ -275,6 +276,15 @@ Polymer({
forwardBackwardImageSequence);
},
/**
* Returns the label to use for take photo button.
* @return {string}
* @private
*/
getTakePhotoLabel_: function(videomode, photoLabel, videoLabel) {
return videomode ? videoLabel : photoLabel;
},
/**
* Returns the label to use for switch mode button.
* @return {string}
......
......@@ -76,6 +76,7 @@
<template is="dom-if" if="[[cameraActive_]]">
<cr-camera id="camera"
take-photo-label="[[takePhotoLabel]]"
capture-video-label="[[captureVideoLabel]]"
switch-mode-to-camera-label="[[switchModeToCameraLabel]]"
switch-mode-to-video-label="[[switchModeToVideoLabel]]"
video-mode-enabled="[[cameraVideoModeEnabled]]">
......
......@@ -43,6 +43,7 @@ Polymer({
discardImageLabel: String,
previewAltText: String,
takePhotoLabel: String,
captureVideoLabel: String,
switchModeToCameraLabel: String,
switchModeToVideoLabel: String,
......
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