Commit 7fb78619 authored by mahmadi's avatar mahmadi Committed by Commit bot

[MD Settings][People] Fixes take picture button disappearing on page refresh

BUG=660835

Review-Url: https://codereview.chromium.org/2480603003
Cr-Commit-Position: refs/heads/master@{#430272}
parent ea773800
......@@ -122,10 +122,14 @@ void ChangePictureHandler::OnJavascriptAllowed() {
content::NotificationService::AllSources());
registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED,
content::NotificationService::AllSources());
camera_observer_.Add(CameraPresenceNotifier::GetInstance());
}
void ChangePictureHandler::OnJavascriptDisallowed() {
registrar_.RemoveAll();
camera_observer_.Remove(CameraPresenceNotifier::GetInstance());
}
void ChangePictureHandler::SendDefaultImages() {
......@@ -204,10 +208,6 @@ void ChangePictureHandler::HandlePageInitialized(const base::ListValue* args) {
AllowJavascript();
CameraPresenceNotifier* camera = CameraPresenceNotifier::GetInstance();
if (!camera_observer_.IsObserving(camera))
camera_observer_.Add(camera);
SendDefaultImages();
SendSelectedImage();
UpdateProfileImage();
......
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