Chromium Code Reviews| 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); |
| }; |