• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SCREEN_H_
7 #pragma once
8 
9 #include "chrome/browser/chromeos/login/camera_controller.h"
10 #include "chrome/browser/chromeos/login/user_image_view.h"
11 #include "chrome/browser/chromeos/login/view_screen.h"
12 #include "content/common/notification_observer.h"
13 #include "content/common/notification_registrar.h"
14 #include "third_party/skia/include/core/SkBitmap.h"
15 
16 namespace chromeos {
17 
18 class UserImageScreen: public ViewScreen<UserImageView>,
19                        public CameraController::Delegate,
20                        public UserImageView::Delegate,
21                        public NotificationObserver {
22  public:
23   explicit UserImageScreen(WizardScreenDelegate* delegate);
24   virtual ~UserImageScreen();
25 
26   // Overridden from ViewScreen:
27   virtual void Refresh();
28   virtual void Hide();
29   virtual UserImageView* AllocateView();
30 
31   // CameraController::Delegate implementation:
32   virtual void OnCaptureSuccess();
33   virtual void OnCaptureFailure();
34 
35   // UserImageView::Delegate implementation:
36   virtual void StartCamera();
37   virtual void StopCamera();
38   virtual void OnPhotoTaken(const SkBitmap& image);
39   virtual void OnDefaultImageSelected(int index);
40 
41   // NotificationObserver implementation:
42   virtual void Observe(NotificationType type,
43                        const NotificationSource& source,
44                        const NotificationDetails& details);
45 
46  private:
47   CameraController camera_controller_;
48 
49   NotificationRegistrar registrar_;
50 
51   DISALLOW_COPY_AND_ASSIGN(UserImageScreen);
52 };
53 
54 }  // namespace chromeos
55 
56 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_USER_IMAGE_SCREEN_H_
57 
58 
59