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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc

Issue 2480603003: [MD Settings][People] Fixes take picture button disappearing on page refresh (Closed)
Patch Set: Created 4 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc
index f83a8b2a6e546a2f56d090642e279be67872d2f2..6a668cceebe439f1e7094de8be03ab1256e63775 100644
--- a/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/change_picture_handler.cc
@@ -205,8 +205,13 @@ void ChangePictureHandler::HandlePageInitialized(const base::ListValue* args) {
AllowJavascript();
CameraPresenceNotifier* camera = CameraPresenceNotifier::GetInstance();
- if (!camera_observer_.IsObserving(camera))
- camera_observer_.Add(camera);
+ if (camera_observer_.IsObserving(camera)) {
+ // If already observing CameraPresenceNotifier (can happen when refreshing
+ // the page), we need to stop observing it, then re-observe it so that
+ // ChangePictureHandler::OnCameraPresenceCheckDone() gets called again.
+ camera_observer_.Remove(camera);
+ }
+ camera_observer_.Add(camera);
SendDefaultImages();
SendSelectedImage();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698