1 // Copyright (c) 2010 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_WIZARD_SCREEN_H_ 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_SCREEN_H_ 7 #pragma once 8 9 #include "ui/gfx/canvas.h" 10 11 class WizardScreen; 12 namespace chromeos { 13 class ScreenObserver; 14 } // namespace chromeos 15 namespace gfx { 16 class Size; 17 } // namespace gfx 18 namespace views { 19 class View; 20 } // namespace views 21 22 // Interface that login wizard exposes to its screens. 23 class WizardScreenDelegate { 24 public: 25 // Returns top level view of the wizard. 26 virtual views::View* GetWizardView() = 0; 27 28 // Returns observer screen should notify. 29 virtual chromeos::ScreenObserver* GetObserver(WizardScreen* screen) = 0; 30 31 // Forces the current screen to be shown immediately. 32 virtual void ShowCurrentScreen() = 0; 33 34 protected: 35 virtual ~WizardScreenDelegate() {} 36 }; 37 38 // Interface that defines login wizard screens. 39 // Also holds a reference to a delegate. 40 class WizardScreen { 41 public: 42 // Makes wizard screen visible. 43 virtual void Show() = 0; 44 // Makes wizard screen invisible. 45 virtual void Hide() = 0; 46 // Returns the size the screen. 47 virtual gfx::Size GetScreenSize() const = 0; 48 49 protected: 50 explicit WizardScreen(WizardScreenDelegate* delegate): delegate_(delegate) {} 51 virtual ~WizardScreen() {} 52 53 WizardScreenDelegate* delegate() { return delegate_; } 54 55 // Refreshes screen state. Should be called after view is made visible. 56 virtual void Refresh() = 0; 57 58 private: 59 WizardScreenDelegate* delegate_; 60 }; 61 62 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_WIZARD_SCREEN_H_ 63