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/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" 13 14 class GURL; 15 16 namespace content { 17 class WebUI; 18 } 19 20 namespace gfx { 21 class Image; 22 } 23 24 namespace chromeos { 25 26 class ScreenLocker; 27 28 // ScreenLockerDelegate takes care of displaying the lock screen UI. 29 class ScreenLockerDelegate { 30 public: 31 explicit ScreenLockerDelegate(ScreenLocker* screen_locker); 32 virtual ~ScreenLockerDelegate(); 33 34 // Initialize the screen locker delegate. This will call ScreenLockReady when 35 // done to notify ScreenLocker. 36 virtual void LockScreen() = 0; 37 38 // Inform the screen locker that the screen has been locked 39 virtual void ScreenLockReady(); 40 41 // This function is called when ScreenLocker::Authenticate is called to 42 // attempt to authenticate with a given password. 43 virtual void OnAuthenticate() = 0; 44 45 // Enable/disable password input. 46 virtual void SetInputEnabled(bool enabled) = 0; 47 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; 54 55 // Close message bubble to clear error messages. 56 virtual void ClearErrors() = 0; 57 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; 61 62 // Returns the native window displaying the lock screen. 63 virtual gfx::NativeWindow GetNativeWindow() const = 0; 64 65 // Returns WebUI associated with screen locker implementation or NULL if 66 // there isn't one. 67 virtual content::WebUI* GetAssociatedWebUI(); 68 69 // Called when webui lock screen is ready. 70 virtual void OnLockWebUIReady() = 0; 71 72 // Called when webui lock screen wallpaper is loaded and displayed. 73 virtual void OnLockBackgroundDisplayed() = 0; 74 75 // Returns screen locker associated with delegate. screen_locker()76 ScreenLocker* screen_locker() { return screen_locker_; } 77 78 protected: 79 // ScreenLocker that owns this delegate. 80 ScreenLocker* screen_locker_; 81 82 DISALLOW_COPY_AND_ASSIGN(ScreenLockerDelegate); 83 }; 84 85 } // namespace chromeos 86 87 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_LOCK_SCREEN_LOCKER_DELEGATE_H_ 88