Home | History | Annotate | Download | only in login
      1 // Copyright (c) 2011 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_LOGIN_DISPLAY_HOST_H_
      6 #define CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
      7 #pragma once
      8 
      9 #include <string>
     10 
     11 #include "chrome/browser/chromeos/login/background_view.h"
     12 #include "chrome/browser/chromeos/customization_document.h"
     13 #include "chrome/browser/chromeos/login/login_display.h"
     14 #include "googleurl/src/gurl.h"
     15 #include "ui/gfx/native_widget_types.h"
     16 
     17 namespace chromeos {
     18 
     19 // An interface that defines OOBE/login screen host.
     20 // Host encapsulates implementation specific background window (views/WebUI),
     21 // OOBE/login controllers, views/WebUI UI implementation (such as LoginDisplay).
     22 class LoginDisplayHost {
     23  public:
     24   virtual ~LoginDisplayHost() {}
     25 
     26   // Creates UI implementation specific login display instance (views/WebUI).
     27   virtual LoginDisplay* CreateLoginDisplay(
     28       LoginDisplay::Delegate* delegate) const = 0;
     29 
     30   // Returns corresponding native window.
     31   // TODO(nkostylev): Might be refactored, move to views-specific code.
     32   virtual gfx::NativeWindow GetNativeWindow() const = 0;
     33 
     34   // Called when browsing session starts so
     35   // LoginDisplayHost instance may delete itself.
     36   virtual void OnSessionStart() = 0;
     37 
     38   // TODO(nkostylev): Refactor enum.
     39   // Sets current step on OOBE progress bar.
     40   virtual void SetOobeProgress(BackgroundView::LoginStep step) = 0;
     41 
     42   // Toggles OOBE progress bar visibility, the bar is hidden by default.
     43   virtual void SetOobeProgressBarVisible(bool visible) = 0;
     44 
     45   // Enable/disable shutdown button.
     46   virtual void SetShutdownButtonEnabled(bool enable) = 0;
     47 
     48   // Toggles whether status area is enabled.
     49   virtual void SetStatusAreaEnabled(bool enable) = 0;
     50 
     51   // Toggles status area visibility.
     52   virtual void SetStatusAreaVisible(bool visible) = 0;
     53 
     54   // Creates and shows a background window.
     55   virtual void ShowBackground() = 0;
     56 
     57   // Starts out-of-box-experience flow or shows other screen handled by
     58   // Wizard controller i.e. camera, recovery.
     59   // One could specify start screen with |first_screen_name|.
     60   virtual void StartWizard(
     61       const std::string& first_screen_name,
     62       const GURL& start_url) = 0;
     63 
     64   // Starts sign in screen.
     65   virtual void StartSignInScreen() = 0;
     66 };
     67 
     68 }  // namespace chromeos
     69 
     70 #endif  // CHROME_BROWSER_CHROMEOS_LOGIN_LOGIN_DISPLAY_HOST_H_
     71