| 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);
|
| };
|
|
|
|
|