Commit 5cb57d46 authored by Denis Kuznetsov's avatar Denis Kuznetsov Committed by Commit Bot

Remove unused code

Remove unused oobe_change_picture that was not cleaned up during
work that removed code that used it:
https://chromium-review.googlesource.com/c/chromium/src/+/1488018

Bug: 903577
Change-Id: Ib327d1eaa3ff1ea2c62478c726cc8be6399ceefb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1919205Reviewed-by: default avatarRoman Aleksandrov <raleksandrov@google.com>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Commit-Queue: Denis Kuznetsov [CET] <antrim@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718441}
parent 61bf24c5
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<include src="../login/hd-iron-icon.html"> <include src="../login/hd-iron-icon.html">
<include src="../login/oobe_buttons.html"> <include src="../login/oobe_buttons.html">
<include src="../login/oobe_change_picture.html">
<include src="../login/oobe_dialog.html"> <include src="../login/oobe_dialog.html">
<include src="assistant_optin_flow.html"> <include src="assistant_optin_flow.html">
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
// <include src="../login/hd-iron-icon.js"> // <include src="../login/hd-iron-icon.js">
// <include src="../login/oobe_types.js"> // <include src="../login/oobe_types.js">
// <include src="../login/oobe_buttons.js"> // <include src="../login/oobe_buttons.js">
// <include src="../login/oobe_change_picture.js">
// <include src="../login/oobe_dialog_host_behavior.js"> // <include src="../login/oobe_dialog_host_behavior.js">
// <include src="../login/oobe_dialog.js"> // <include src="../login/oobe_dialog.js">
// <include src="assistant_optin_flow.js"> // <include src="assistant_optin_flow.js">
......
...@@ -32,7 +32,6 @@ js_type_check("closure_compile") { ...@@ -32,7 +32,6 @@ js_type_check("closure_compile") {
":offline_gaia", ":offline_gaia",
":oobe_a11y_option", ":oobe_a11y_option",
":oobe_buttons", ":oobe_buttons",
":oobe_change_picture",
":oobe_dialog", ":oobe_dialog",
":oobe_eula", ":oobe_eula",
":oobe_i18n_dropdown", ":oobe_i18n_dropdown",
...@@ -124,18 +123,6 @@ js_library("offline_ad_login") { ...@@ -124,18 +123,6 @@ js_library("offline_ad_login") {
] ]
} }
js_library("oobe_change_picture") {
deps = [
"//ui/webui/resources/cr_elements/chromeos/cr_picture:cr_picture_list",
"//ui/webui/resources/cr_elements/chromeos/cr_picture:cr_picture_pane",
"//ui/webui/resources/cr_elements/chromeos/cr_picture:cr_picture_types",
"//ui/webui/resources/js:assert",
"//ui/webui/resources/js:i18n_behavior",
"//ui/webui/resources/js:load_time_data",
"//ui/webui/resources/js:util",
]
}
js_library("multidevice_setup_first_run") { js_library("multidevice_setup_first_run") {
deps = [ deps = [
"//ui/webui/resources/cr_components/chromeos/multidevice_setup:mojo_api", "//ui/webui/resources/cr_components/chromeos/multidevice_setup:mojo_api",
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
<include src="oobe_a11y_option.html"> <include src="oobe_a11y_option.html">
<include src="oobe_adb_sideloading_screen.html"> <include src="oobe_adb_sideloading_screen.html">
<include src="oobe_buttons.html"> <include src="oobe_buttons.html">
<include src="oobe_change_picture.html">
<include src="oobe_dialog.html"> <include src="oobe_dialog.html">
<include src="oobe_network_icons.html"> <include src="oobe_network_icons.html">
<include src="oobe_reset.html"> <include src="oobe_reset.html">
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
// <include src="oobe_a11y_option.js"> // <include src="oobe_a11y_option.js">
// <include src="oobe_adb_sideloading_screen.js"> // <include src="oobe_adb_sideloading_screen.js">
// <include src="oobe_buttons.js"> // <include src="oobe_buttons.js">
// <include src="oobe_change_picture.js">
// <include src="oobe_dialog.js"> // <include src="oobe_dialog.js">
// <include src="oobe_terms_of_service.js"> // <include src="oobe_terms_of_service.js">
// <include src="arc_terms_of_service.js"> // <include src="arc_terms_of_service.js">
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
<include src="oobe_a11y_option.html"> <include src="oobe_a11y_option.html">
<include src="oobe_adb_sideloading_screen.html"> <include src="oobe_adb_sideloading_screen.html">
<include src="oobe_buttons.html"> <include src="oobe_buttons.html">
<include src="oobe_change_picture.html">
<include src="oobe_dialog.html"> <include src="oobe_dialog.html">
<include src="oobe_eula.html"> <include src="oobe_eula.html">
<include src="oobe_hid_detection.html"> <include src="oobe_hid_detection.html">
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
// <include src="oobe_a11y_option.js"> // <include src="oobe_a11y_option.js">
// <include src="oobe_adb_sideloading_screen.js"> // <include src="oobe_adb_sideloading_screen.js">
// <include src="oobe_buttons.js"> // <include src="oobe_buttons.js">
// <include src="oobe_change_picture.js">
// <include src="oobe_dialog.js"> // <include src="oobe_dialog.js">
// <include src="oobe_eula.js"> // <include src="oobe_eula.js">
// <include src="oobe_terms_of_service.js"> // <include src="oobe_terms_of_service.js">
......
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/cr_picture_list.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/cr_picture_pane.html">
<link rel="import" href="chrome://resources/cr_elements/chromeos/cr_picture/cr_picture_types.html">
<link rel="import" href="chrome://resources/html/i18n_behavior.html">
<link rel="import" href="chrome://resources/html/util.html">
<dom-module id="oobe-change-picture">
<template>
<style>
#description {
font-size: 13px;
line-height: 10px;
margin-inline-end: 32px;
margin-inline-start: 8px;
}
#container {
align-items: flex-start;
display: flex;
margin-bottom: 32px;
margin-inline-start: 8px;
min-height: 0;
padding-top: 32px;
}
#picturePane {
--cr-picture-image-size: 192px;
flex-shrink: 0;
height: 288px;
margin-inline-end: 28px;
position: relative;
width: 288px;
}
#pictureList {
height: 330px;
margin-inline-end: 32px;
overflow-x: hidden;
overflow-y: auto;
width: 340px;
}
</style>
<div id="description" inner-h-t-m-l="[[getDescription_(locale)]]"></div>
<div id="container">
<cr-picture-pane id="picturePane"
camera-present="[[cameraPresent]]",
image-src="[[getImageSrc_(selectedItem_)]]"
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,
'switchModeToVideo')]]"
camera-video-mode-enabled="[[cameraVideoModeEnabled]]">
</cr-picture-pane>
<cr-picture-list id="pictureList"
camera-present="[[cameraPresent]]"
default-images="[[getDefaultImages_(defaultImages,
firstDefaultImageIndex)]]"
selected-item="{{selectedItem_}}"
old-image-label="[[i18nDynamic(locale, 'photoFromCamera')]]"
profile-image-label="[[i18nDynamic(locale, 'profilePhoto')]]"
take-photo-label="[[i18nDynamic(locale, 'takePhoto')]]"
capture-video-label="[[i18nDynamic(locale, 'captureVideo')]]">
</cr-picture-list>
</div>
</template>
</dom-module>
// Copyright 2015 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.
/**
* An object describing a default image.
* @typedef {{
* author: string,
* title: string,
* url: string,
* website: string
* }}
*/
var OobeDefaultImage;
/** @const */ var OOBE_DEFAULT_AVATAR_IMAGE_URL =
'chrome://theme/IDR_LOGIN_DEFAULT_USER';
/**
* @fileoverview
* 'oobe-change-picture' is a custom element containing controls to select
* a user's picture.
*/
Polymer({
is: 'oobe-change-picture',
behaviors: [I18nBehavior],
properties: {
/**
* True if the user has a plugged-in webcam.
* @private {boolean}
*/
cameraPresent: {
type: Boolean,
value: false,
},
/** Specifies the selected image index. */
selectedImageIndex: Number,
/** Specifies the selected image URL, used to specify the initial image. */
selectedImageUrl: {
type: String,
observer: 'selectedImageUrlChanged_',
},
/**
* The default user images.
* @private {!Array<!OobeDefaultImage>}
*/
defaultImages: {
type: Array,
value: function() {
return [];
},
},
/**
* The index of the first default image to use in the selection list.
* @private
*/
firstDefaultImageIndex: Number,
/**
* True when camera video mode is enabled.
* @private {boolean}
*/
cameraVideoModeEnabled: {
type: Boolean,
value: function() {
return loadTimeData.getBoolean('changePictureVideoModeEnabled');
},
readOnly: true,
},
/**
* The currently selected item. This property is bound to the iron-selector
* and never directly assigned. This may be undefined momentarily as
* the selection changes due to iron-selector implementation details.
* @private {?CrPicture.ImageElement}
*/
selectedItem_: {
type: Object,
value: null,
},
},
listeners: {
'discard-image': 'onDiscardImage_',
'image-activate': 'onImageActivate_',
'focus-action': 'onFocusAction_',
'photo-taken': 'onPhotoTaken_',
'switch-mode': 'onSwitchMode_',
},
/** @private {?CrPictureListElement} */
pictureList_: null,
/** @override */
ready: function() {
this.pictureList_ =
/** @type {CrPictureListElement} */ (this.$.pictureList);
},
/** Called when the screen is shown. */
focus: function() {
this.$.pictureList.setFocus();
},
/**
* setProfileImageUrl is called possibly after sync.
* @param {string} imageUrl
* @param {boolean} selected
*/
setProfileImageUrl: function(imageUrl, selected) {
this.pictureList_.setProfileImageUrl(imageUrl, selected);
},
/**
* @return {string}
* @private
*/
getDescription_: function() {
return this.i18nAdvanced(
'userImageScreenDescription', {substitutions: [], tags: ['br']});
},
/**
* selectedImageUrl is set by the host initially and possibly after sync.
* @param {string} selectedImageUrl
* @private
*/
selectedImageUrlChanged_: function(selectedImageUrl) {
if (this.selectedImageIndex >= this.firstDefaultImageIndex) {
this.pictureList_.setSelectedImageUrl(selectedImageUrl);
} else {
this.pictureList_.setOldImageUrl(
selectedImageUrl, this.selectedImageIndex);
}
this.pictureList_.setFocus();
},
/**
* Selects an image element.
* @param {!CrPicture.ImageElement} image
* @private
*/
selectImage_: function(image) {
switch (image.dataset.type) {
case CrPicture.SelectionTypes.CAMERA:
this.sendSelectImage_(image.dataset.type, '');
/** CrPicturePaneElement */ (this.$.picturePane).takePhoto();
break;
case CrPicture.SelectionTypes.FILE:
assertNotReached();
break;
case CrPicture.SelectionTypes.PROFILE:
this.sendSelectImage_(image.dataset.type, '');
break;
case CrPicture.SelectionTypes.OLD:
var imageIndex = image.dataset.imageIndex;
if (imageIndex !== undefined && imageIndex >= 0 && image.src) {
this.sendSelectImage_(
CrPicture.SelectionTypes.DEFAULT, image.dataset.url);
} else {
this.sendSelectImage_(image.dataset.type, '');
}
break;
case CrPicture.SelectionTypes.DEFAULT:
this.sendSelectImage_(image.dataset.type, image.dataset.url);
break;
default:
assertNotReached('Selected unknown image type');
}
},
/**
* @param {string} type
* @param {string} src
* @private
*/
sendSelectImage_: function(type, src) {
chrome.send('selectImage', [type, src, true]);
},
/**
* Handler for when an image is activated.
* @param {!CustomEvent<!CrPicture.ImageElement>} event
* @private
*/
onImageActivate_: function(event) {
this.selectImage_(event.detail);
},
/** Focus the action button in the picture pane. */
onFocusAction_: function() {
/** CrPicturePaneElement */ (this.$.picturePane).focusActionButton();
},
/**
* @param {!CustomEvent<!{photoDataUrl: string}>} event
* @private
*/
onPhotoTaken_: function(event) {
chrome.send('photoTaken', [event.detail.photoDataUrl]);
this.pictureList_.setOldImageUrl(event.detail.photoDataUrl);
this.pictureList_.setFocus();
this.sendSelectImage_(CrPicture.SelectionTypes.OLD, '');
announceAccessibleMessage(
loadTimeData.getString('photoCaptureAccessibleText'));
},
/**
* @param {!CustomEvent<boolean>} event
* @private
*/
onSwitchMode_: function(event) {
var videomode = event.detail;
var modeMessageId =
videomode ? 'videoModeAccessibleText' : 'photoModeAccessibleText';
announceAccessibleMessage(loadTimeData.getString(modeMessageId));
},
/** @private */
onDiscardImage_: function() {
this.pictureList_.setOldImageUrl(CrPicture.kDefaultImageUrl);
// Revert to profile image as we don't know what last used default image is.
this.sendSelectImage_(CrPicture.SelectionTypes.PROFILE, '');
chrome.send('discardPhoto'); // Plays 'SOUND_OBJECT_DELETE'.
announceAccessibleMessage(this.i18n('photoDiscardAccessibleText'));
},
/**
* @param {CrPicture.ImageElement} selectedItem
* @return {string}
* @private
*/
getImageSrc_: function(selectedItem) {
return (selectedItem && selectedItem.dataset.url) || '';
},
/**
* @param {CrPicture.ImageElement} selectedItem
* @return {string}
* @private
*/
getImageType_: function(selectedItem) {
return (selectedItem && selectedItem.dataset.type) ||
CrPicture.SelectionTypes.NONE;
},
/**
* @param {!Array<!OobeDefaultImage>} defaultImages
* @param {number} firstDefaultImageIndex
* @return {!Array<!OobeDefaultImage>}
* @private
*/
getDefaultImages_: function(defaultImages, firstDefaultImageIndex) {
return defaultImages.slice(firstDefaultImageIndex);
},
});
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