Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / login / lock / screen_locker_delegate.h
blob8ddd8bca75f15a37589df1914d245f5dc84cdc84
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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_DELEGATE_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_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 "chrome/browser/chromeos/login/ui/login_display.h"
12 #include "ui/gfx/native_widget_types.h"
14 class GURL;
16 namespace content {
17 class WebUI;
20 namespace gfx {
21 class Image;
24 namespace chromeos {
26 class ScreenLocker;
28 // ScreenLockerDelegate takes care of displaying the lock screen UI.
29 class ScreenLockerDelegate {
30 public:
31 explicit ScreenLockerDelegate(ScreenLocker* screen_locker);
32 virtual ~ScreenLockerDelegate();
34 // Initialize the screen locker delegate. This will call ScreenLockReady when
35 // done to notify ScreenLocker.
36 virtual void LockScreen() = 0;
38 // Inform the screen locker that the screen has been locked
39 virtual void ScreenLockReady();
41 // This function is called when ScreenLocker::Authenticate is called to
42 // attempt to authenticate with a given password.
43 virtual void OnAuthenticate() = 0;
45 // Enable/disable password input.
46 virtual void SetInputEnabled(bool enabled) = 0;
48 // Disables all UI needed and shows error bubble with |message|.
49 // If |sign_out_only| is true then all other input except "Sign Out"
50 // button is blocked.
51 virtual void ShowErrorMessage(
52 int error_msg_id,
53 HelpAppLauncher::HelpTopic help_topic_id) = 0;
55 // Close message bubble to clear error messages.
56 virtual void ClearErrors() = 0;
58 // Allows to have visual effects once unlock authentication is successful,
59 // Must call ScreenLocker::UnlockOnLoginSuccess() once all effects are done.
60 virtual void AnimateAuthenticationSuccess() = 0;
62 // Returns the native window displaying the lock screen.
63 virtual gfx::NativeWindow GetNativeWindow() const = 0;
65 // Returns WebUI associated with screen locker implementation or NULL if
66 // there isn't one.
67 virtual content::WebUI* GetAssociatedWebUI();
69 // Called when webui lock screen is ready.
70 virtual void OnLockWebUIReady() = 0;
72 // Called when webui lock screen wallpaper is loaded and displayed.
73 virtual void OnLockBackgroundDisplayed() = 0;
75 // Called when the webui header bar becomes visible.
76 virtual void OnHeaderBarVisible() = 0;
78 // Returns screen locker associated with delegate.
79 ScreenLocker* screen_locker() { return screen_locker_; }
81 protected:
82 // ScreenLocker that owns this delegate.
83 ScreenLocker* screen_locker_;
85 DISALLOW_COPY_AND_ASSIGN(ScreenLockerDelegate);
88 } // namespace chromeos
90 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_DELEGATE_H_