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/chromeos/options/take_photo_dialog.h

Issue 7523063: Add a hook for capturing a user profile photo and saving it to file and local state. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebased Created 9 years, 5 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/user_manager.cc ('k') | chrome/browser/chromeos/options/take_photo_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/take_photo_dialog.h
diff --git a/chrome/browser/chromeos/options/take_photo_dialog.h b/chrome/browser/chromeos/options/take_photo_dialog.h
index c6956db7345c4a17fef6245205b05a58f0a101b7..191783c44b0f4759f584b0e6f3658bc6b8697995 100644
--- a/chrome/browser/chromeos/options/take_photo_dialog.h
+++ b/chrome/browser/chromeos/options/take_photo_dialog.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
#include "chrome/browser/chromeos/login/camera_controller.h"
#include "chrome/browser/chromeos/login/take_photo_view.h"
#include "content/common/notification_observer.h"
@@ -57,6 +58,34 @@ class TakePhotoDialog : public views::DialogDelegateView,
virtual void OnCaptureSuccess();
virtual void OnCaptureFailure();
+ // Interface that observers of this dialog must implement in order
+ // to receive notification for capture success/failure.
+ class Observer {
+ public:
+ // Called when image is captured and is displayed
+ virtual void OnCaptureSuccess(
+ TakePhotoDialog* dialog,
+ TakePhotoView* view) = 0;
+ // Called when capture fails and error image is displayed
+ virtual void OnCaptureFailure(
+ TakePhotoDialog* dialog,
+ TakePhotoView* view) = 0;
+ // Called when capture is stopped and image is not being updated
+ virtual void OnCapturingStopped(
+ TakePhotoDialog* dialog,
+ TakePhotoView* view) = 0;
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ void AddObserver(Observer* obs);
+ void RemoveObserver(Observer* obs);
+
+ void NotifyOnCaptureSuccess();
+ void NotifyOnCaptureFailure();
+ void NotifyOnCapturingStopped();
+
// NotificationObserver implementation:
virtual void Observe(int type,
const NotificationSource& source,
@@ -80,6 +109,8 @@ class TakePhotoDialog : public views::DialogDelegateView,
Delegate* delegate_;
+ ObserverList<Observer> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(TakePhotoDialog);
};
« no previous file with comments | « chrome/browser/chromeos/login/user_manager.cc ('k') | chrome/browser/chromeos/options/take_photo_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698