1 // Copyright (c) 2012 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_SCREEN_LOCKER_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_DELEGATE_H_
8 #include "base/callback_forward.h"
9 #include "base/strings/string16.h"
10 #include "chrome/browser/chromeos/login/help_app_launcher.h"
11 #include "ui/gfx/native_widget_types.h"
27 // ScreenLockerDelegate takes care of displaying the lock screen UI.
28 class ScreenLockerDelegate
{
30 explicit ScreenLockerDelegate(ScreenLocker
* screen_locker
);
31 virtual ~ScreenLockerDelegate();
33 // Initialize the screen locker delegate. This will call ScreenLockReady when
34 // done to notify ScreenLocker.
35 virtual void LockScreen() = 0;
37 // Inform the screen locker that the screen has been locked
38 virtual void ScreenLockReady();
40 // This function is called when ScreenLocker::Authenticate is called to
41 // attempt to authenticate with a given password.
42 virtual void OnAuthenticate() = 0;
44 // Enable/disable password input.
45 virtual void SetInputEnabled(bool enabled
) = 0;
47 // Displays a banner containing |message| on the lock screen.
48 virtual void ShowBannerMessage(const std::string
& message
) = 0;
50 // Shows a button inside the user pod on the lock screen with an icon.
51 virtual void ShowUserPodButton(const std::string
& username
,
52 const std::string
& iconURL
,
53 const base::Closure
& click_callback
) = 0;
55 // Disables all UI needed and shows error bubble with |message|.
56 // If |sign_out_only| is true then all other input except "Sign Out"
58 virtual void ShowErrorMessage(
60 HelpAppLauncher::HelpTopic help_topic_id
) = 0;
62 // Close message bubble to clear error messages.
63 virtual void ClearErrors() = 0;
65 // Allows to have visual effects once unlock authentication is successful,
66 // Must call ScreenLocker::UnlockOnLoginSuccess() once all effects are done.
67 virtual void AnimateAuthenticationSuccess() = 0;
69 // Returns the native window displaying the lock screen.
70 virtual gfx::NativeWindow
GetNativeWindow() const = 0;
72 // Returns WebUI associated with screen locker implementation or NULL if
74 virtual content::WebUI
* GetAssociatedWebUI();
76 // Called when webui lock screen is ready.
77 virtual void OnLockWebUIReady() = 0;
79 // Called when webui lock screen wallpaper is loaded and displayed.
80 virtual void OnLockBackgroundDisplayed() = 0;
82 // Returns screen locker associated with delegate.
83 ScreenLocker
* screen_locker() { return screen_locker_
; }
86 // ScreenLocker that owns this delegate.
87 ScreenLocker
* screen_locker_
;
89 DISALLOW_COPY_AND_ASSIGN(ScreenLockerDelegate
);
92 } // namespace chromeos
94 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREEN_LOCKER_DELEGATE_H_