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 10 namespace chromeos { 11 12 class 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 virtual void OnConnectToNetworkRequested( 29 const std::string& service_path) = 0; 30 }; 31 32 virtual ~UpdateScreenActor() {} 33 34 // Sets screen this actor belongs to. 35 virtual void SetDelegate(Delegate* screen) = 0; 36 37 // Shows the screen. 38 virtual void Show() = 0; 39 40 // Hides the screen. 41 virtual void Hide() = 0; 42 43 virtual void PrepareToShow() = 0; 44 45 // Shows manual reboot info message. 46 virtual void ShowManualRebootInfo() = 0; 47 48 // Sets current progress in percents. 49 virtual void SetProgress(int progress) = 0; 50 51 // Shows estimated time left message. 52 virtual void ShowEstimatedTimeLeft(bool visible) = 0; 53 54 // Sets current estimation for time left in the downloading stage. 55 virtual void SetEstimatedTimeLeft(const base::TimeDelta& time) = 0; 56 57 // Shows message under progress bar. 58 virtual void ShowProgressMessage(bool visible) = 0; 59 60 // Sets message under progress bar. 61 virtual void SetProgressMessage(ProgressMessage message) = 0; 62 63 // Shows screen curtains. 64 virtual void ShowCurtain(bool visible) = 0; 65 }; 66 67 } // namespace chromeos 68 69 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_ACTOR_H_ 70