Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5150)

Unified Diff: chrome/browser/resources/chromeos/login/oobe_screen_user_image.js

Issue 2666893002: Delete "Google Profile photo" for the Active Directory (Closed)
Patch Set: Comment Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_image_screen.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
diff --git a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
index 0628c6a7bbdf1ee5a44524c1a2efc476d82c7fce..c6589fb7c45dddc8d3a8cc3ca1a4dd50e38a637b 100644
--- a/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
+++ b/chrome/browser/resources/chromeos/login/oobe_screen_user_image.js
@@ -10,6 +10,7 @@ login.createScreen('UserImageScreen', 'user-image', function() {
var CONTEXT_KEY_IS_CAMERA_PRESENT = 'isCameraPresent';
var CONTEXT_KEY_SELECTED_IMAGE_URL = 'selectedImageURL';
var CONTEXT_KEY_PROFILE_PICTURE_DATA_URL = 'profilePictureDataURL';
+ var CONTEXT_KEY_HAS_GAIA_ACCOUNT = 'hasGaiaAccount';
var UserImagesGrid = options.UserImagesGrid;
var ButtonImages = UserImagesGrid.ButtonImages;
@@ -47,26 +48,6 @@ login.createScreen('UserImageScreen', 'user-image', function() {
loadTimeData.getString('takePhoto'),
loadTimeData.getString('photoFromCamera'));
- this.profileImageLoading = true;
-
- // Profile image data (if present).
- this.profileImage_ = imageGrid.addItem(
- ButtonImages.PROFILE_PICTURE, // Image URL.
- loadTimeData.getString('profilePhoto'), // Title.
- undefined, // Click handler.
- 0, // Position.
- function(el) {
- // Custom decorator for Profile image element.
- var spinner = el.ownerDocument.createElement('div');
- spinner.className = 'spinner';
- var spinnerBg = el.ownerDocument.createElement('div');
- spinnerBg.className = 'spinner-bg';
- spinnerBg.appendChild(spinner);
- el.appendChild(spinnerBg);
- el.id = 'profile-image';
- });
- this.profileImage_.type = 'profile';
-
$('take-photo').addEventListener(
'click', this.handleTakePhoto_.bind(this));
$('discard-photo').addEventListener(
@@ -91,6 +72,31 @@ login.createScreen('UserImageScreen', 'user-image', function() {
});
this.context.addObserver(CONTEXT_KEY_SELECTED_IMAGE_URL,
this.setSelectedImage_);
+ this.context.addObserver(CONTEXT_KEY_HAS_GAIA_ACCOUNT,
+ function(hasGaiaAccount) {
+ if (!hasGaiaAccount) {
+ imageGrid.removeItem(self.profileImage_);
+ } else {
+ self.profileImageLoading = true;
+ // Profile image data (if present).
+ self.profileImage_ = imageGrid.addItem(
+ ButtonImages.PROFILE_PICTURE, // Image URL.
+ loadTimeData.getString('profilePhoto'), // Title.
+ undefined, // Click handler.
+ 0, // Position.
+ function(el) {
+ // Custom decorator for Profile image element.
+ var spinner = el.ownerDocument.createElement('div');
+ spinner.className = 'spinner';
+ var spinnerBg = el.ownerDocument.createElement('div');
+ spinnerBg.className = 'spinner-bg';
+ spinnerBg.appendChild(spinner);
+ el.appendChild(spinnerBg);
+ el.id = 'profile-image';
+ });
+ self.profileImage_.type = 'profile';
+ }
+ });
this.context.addObserver(CONTEXT_KEY_PROFILE_PICTURE_DATA_URL,
function(url) {
self.profileImageLoading = false;
« no previous file with comments | « chrome/browser/chromeos/login/screens/user_image_screen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698