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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_IMAGE_SCREEN_ACTOR_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_IMAGE_SCREEN_ACTOR_H_
18 // Interface for dependency injection between UserImageScreen and its actual
19 // representation, either views based or WebUI.
20 class UserImageScreenActor
{
24 virtual ~Delegate() {}
26 // Called when UI ready to be shown.
27 virtual void OnScreenReady() = 0;
28 // Called when user accepts photo as login user image.
29 virtual void OnPhotoTaken(const std::string
& raw_data
) = 0;
30 // Called to check camera presence.
31 virtual void CheckCameraPresence() = 0;
32 // Called when some image was selected. |is_user_selection| indicates if
33 // it was user selection or image was selected programmatically.
34 virtual void OnImageSelected(const std::string
& image_url
,
35 const std::string
& image_type
,
36 bool is_user_selection
) = 0;
37 // Called when user accepts currently selected image
38 virtual void OnImageAccepted() = 0;
40 // Called when actor is destroyed so there's no dead reference to it.
41 virtual void OnActorDestroyed(UserImageScreenActor
* actor
) = 0;
43 virtual bool profile_picture_absent() = 0;
44 virtual int selected_image() = 0;
45 virtual std::string
profile_picture_data_url() = 0;
49 virtual ~UserImageScreenActor() {}
51 // Sets screen this actor belongs to.
52 virtual void SetDelegate(Delegate
* screen
) = 0;
54 // Prepare the contents to showing.
55 virtual void PrepareToShow() = 0;
57 // Shows the contents of the screen.
58 virtual void Show() = 0;
60 // Hides the contents of the screen.
61 virtual void Hide() = 0;
63 // Selects image with the index specified.
64 virtual void SelectImage(int index
) = 0;
66 // Sends profile image as a data URL to the page.
67 virtual void SendProfileImage(const std::string
& data_url
) = 0;
69 // Indicates that there is no custom profile image for the user.
70 virtual void OnProfileImageAbsent() = 0;
72 // Enables or disables profile picture.
73 virtual void SetProfilePictureEnabled(bool enabled
) = 0;
75 // Sends result of camera check
76 virtual void SetCameraPresent(bool enabled
) = 0;
78 // Hides curtain with spinner.
79 virtual void HideCurtain() = 0;
82 } // namespace chromeos
84 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_USER_IMAGE_SCREEN_ACTOR_H_