OLD | NEW |
| (Empty) |
1 // Copyright 2014 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_LOCK_SCREEN_LOCKER_DELEGATE_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_DELEGATE_H_ | |
7 | |
8 #include "base/callback_forward.h" | |
9 #include "base/macros.h" | |
10 #include "base/strings/string16.h" | |
11 #include "chrome/browser/chromeos/login/help_app_launcher.h" | |
12 #include "chrome/browser/chromeos/login/ui/login_display.h" | |
13 #include "ui/gfx/native_widget_types.h" | |
14 | |
15 class GURL; | |
16 | |
17 namespace content { | |
18 class WebUI; | |
19 } | |
20 | |
21 namespace gfx { | |
22 class Image; | |
23 } | |
24 | |
25 namespace chromeos { | |
26 | |
27 class ScreenLocker; | |
28 | |
29 // ScreenLockerDelegate takes care of displaying the lock screen UI. | |
30 class ScreenLockerDelegate { | |
31 public: | |
32 explicit ScreenLockerDelegate(ScreenLocker* screen_locker); | |
33 virtual ~ScreenLockerDelegate(); | |
34 | |
35 // Initialize the screen locker delegate. This will call ScreenLockReady when | |
36 // done to notify ScreenLocker. | |
37 virtual void LockScreen() = 0; | |
38 | |
39 // Inform the screen locker that the screen has been locked | |
40 virtual void ScreenLockReady(); | |
41 | |
42 // This function is called when ScreenLocker::Authenticate is called to | |
43 // attempt to authenticate with a given password. | |
44 virtual void OnAuthenticate() = 0; | |
45 | |
46 // Enable/disable password input. | |
47 virtual void SetInputEnabled(bool enabled) = 0; | |
48 | |
49 // Disables all UI needed and shows error bubble with |message|. | |
50 // If |sign_out_only| is true then all other input except "Sign Out" | |
51 // button is blocked. | |
52 virtual void ShowErrorMessage( | |
53 int error_msg_id, | |
54 HelpAppLauncher::HelpTopic help_topic_id) = 0; | |
55 | |
56 // Close message bubble to clear error messages. | |
57 virtual void ClearErrors() = 0; | |
58 | |
59 // Allows to have visual effects once unlock authentication is successful, | |
60 // Must call ScreenLocker::UnlockOnLoginSuccess() once all effects are done. | |
61 virtual void AnimateAuthenticationSuccess() = 0; | |
62 | |
63 // Returns the native window displaying the lock screen. | |
64 virtual gfx::NativeWindow GetNativeWindow() const = 0; | |
65 | |
66 // Returns WebUI associated with screen locker implementation or NULL if | |
67 // there isn't one. | |
68 virtual content::WebUI* GetAssociatedWebUI(); | |
69 | |
70 // Called when webui lock screen is ready. | |
71 virtual void OnLockWebUIReady() = 0; | |
72 | |
73 // Called when webui lock screen wallpaper is loaded and displayed. | |
74 virtual void OnLockBackgroundDisplayed() = 0; | |
75 | |
76 // Called when the webui header bar becomes visible. | |
77 virtual void OnHeaderBarVisible() = 0; | |
78 | |
79 // Returns screen locker associated with delegate. | |
80 ScreenLocker* screen_locker() { return screen_locker_; } | |
81 | |
82 protected: | |
83 // ScreenLocker that owns this delegate. | |
84 ScreenLocker* screen_locker_; | |
85 | |
86 DISALLOW_COPY_AND_ASSIGN(ScreenLockerDelegate); | |
87 }; | |
88 | |
89 } // namespace chromeos | |
90 | |
91 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_DELEGATE_H_ | |
OLD | NEW |