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_NETWORK_SCREEN_ACTOR_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_ACTOR_H_
      7 
      8 #include "base/strings/string16.h"
      9 
     10 namespace chromeos {
     11 
     12 // Interface for dependency injection between NetworkScreen and its actual
     13 // representation, either views based or WebUI. Owned by NetworkScreen.
     14 class NetworkScreenActor {
     15  public:
     16   class Delegate {
     17    public:
     18     virtual ~Delegate() {}
     19     virtual void OnActorDestroyed(NetworkScreenActor* actor) = 0;
     20     virtual void OnContinuePressed() = 0;
     21   };
     22 
     23   virtual ~NetworkScreenActor() {}
     24 
     25   // Sets screen this actor belongs to.
     26   virtual void SetDelegate(Delegate* screen) = 0;
     27 
     28   // Prepare the contents to showing.
     29   virtual void PrepareToShow() = 0;
     30 
     31   // Shows the contents of the screen.
     32   virtual void Show() = 0;
     33 
     34   // Hides the contents of the screen.
     35   virtual void Hide() = 0;
     36 
     37   // Shows error message in a bubble.
     38   virtual void ShowError(const string16& message) = 0;
     39 
     40   // Hides error messages showing no error state.
     41   virtual void ClearErrors() = 0;
     42 
     43   // Shows network connecting status or network selection otherwise.
     44   virtual void ShowConnectingStatus(
     45       bool connecting,
     46       const string16& network_id) = 0;
     47 
     48   // Sets whether continue control is enabled.
     49   virtual void EnableContinue(bool enabled) = 0;
     50 };
     51 
     52 }  // namespace chromeos
     53 
     54 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_NETWORK_SCREEN_ACTOR_H_
     55