update_screen_actor.h revision eb525c5499e34cc9c4b825d6d9e75bb07cc06ace
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. 4 5#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_ACTOR_H_ 6#define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_ACTOR_H_ 7 8#include "base/time/time.h" 9 10namespace chromeos { 11 12class UpdateScreenActor { 13 public: 14 // Indices for corresponding info messages during update stage. 15 enum ProgressMessage { 16 PROGRESS_MESSAGE_UPDATE_AVAILABLE = 0, 17 PROGRESS_MESSAGE_INSTALLING_UPDATE, 18 PROGRESS_MESSAGE_VERIFYING, 19 PROGRESS_MESSAGE_FINALIZING 20 }; 21 22 class Delegate { 23 public: 24 virtual ~Delegate() {} 25 // Force cancel update. 26 virtual void CancelUpdate() = 0; 27 virtual void OnActorDestroyed(UpdateScreenActor* actor) = 0; 28 }; 29 30 virtual ~UpdateScreenActor() {} 31 32 // Sets screen this actor belongs to. 33 virtual void SetDelegate(Delegate* screen) = 0; 34 35 // Shows the screen. 36 virtual void Show() = 0; 37 38 // Hides the screen. 39 virtual void Hide() = 0; 40 41 virtual void PrepareToShow() = 0; 42 43 // Shows manual reboot info message. 44 virtual void ShowManualRebootInfo() = 0; 45 46 // Sets current progress in percents. 47 virtual void SetProgress(int progress) = 0; 48 49 // Shows estimated time left message. 50 virtual void ShowEstimatedTimeLeft(bool visible) = 0; 51 52 // Sets current estimation for time left in the downloading stage. 53 virtual void SetEstimatedTimeLeft(const base::TimeDelta& time) = 0; 54 55 // Shows message under progress bar. 56 virtual void ShowProgressMessage(bool visible) = 0; 57 58 // Sets message under progress bar. 59 virtual void SetProgressMessage(ProgressMessage message) = 0; 60 61 // Shows screen curtains. 62 virtual void ShowCurtain(bool visible) = 0; 63}; 64 65} // namespace chromeos 66 67#endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_ACTOR_H_ 68