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

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: Addressed Nirnimesh's comments 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
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..6cd99de0b892d1f6af766ed7886a5b39f27ccc07 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,31 @@ 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:
+ virtual void OnCaptureSuccess(
whywhat 2011/08/02 15:17:02 Could you add comments about each method. When exa
frankf 2011/08/03 01:41:49 Done.
+ TakePhotoDialog* dialog,
+ TakePhotoView* view) = 0;
+ virtual void OnCaptureFailure(
+ TakePhotoDialog* dialog,
+ TakePhotoView* view) = 0;
+ 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 +106,8 @@ class TakePhotoDialog : public views::DialogDelegateView,
Delegate* delegate_;
+ ObserverList<Observer> observer_list_;
+
DISALLOW_COPY_AND_ASSIGN(TakePhotoDialog);
};

Powered by Google App Engine
This is Rietveld 408576698