Home | History | Annotate | Download | only in screens
      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 
     26     // Force cancel update.
     27     virtual void CancelUpdate() = 0;
     28 
     29     // Called prior to destroying |actor|.
     30     virtual void OnActorDestroyed(UpdateScreenActor* actor) = 0;
     31 
     32     // Called any time a new network connect request occurs.
     33     virtual void OnConnectToNetworkRequested() = 0;
     34   };
     35 
     36   virtual ~UpdateScreenActor() {}
     37 
     38   // Sets screen this actor belongs to.
     39   virtual void SetDelegate(Delegate* screen) = 0;
     40 
     41   // Shows the screen.
     42   virtual void Show() = 0;
     43 
     44   // Hides the screen.
     45   virtual void Hide() = 0;
     46 
     47   virtual void PrepareToShow() = 0;
     48 
     49   // Shows manual reboot info message.
     50   virtual void ShowManualRebootInfo() = 0;
     51 
     52   // Sets current progress in percents.
     53   virtual void SetProgress(int progress) = 0;
     54 
     55   // Shows estimated time left message.
     56   virtual void ShowEstimatedTimeLeft(bool visible) = 0;
     57 
     58   // Sets current estimation for time left in the downloading stage.
     59   virtual void SetEstimatedTimeLeft(const base::TimeDelta& time) = 0;
     60 
     61   // Shows message under progress bar.
     62   virtual void ShowProgressMessage(bool visible) = 0;
     63 
     64   // Sets message under progress bar.
     65   virtual void SetProgressMessage(ProgressMessage message) = 0;
     66 
     67   // Shows screen curtains.
     68   virtual void ShowCurtain(bool visible) = 0;
     69 };
     70 
     71 }  // namespace chromeos
     72 
     73 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_UPDATE_SCREEN_ACTOR_H_
     74