1 // Copyright 2014 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.
5 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_
8 #include "base/macros.h"
9 #include "chrome/browser/chromeos/login/screens/base_screen.h"
10 #include "chrome/browser/chromeos/login/screens/host_pairing_screen_actor.h"
11 #include "components/login/screens/screen_context.h"
12 #include "components/pairing/host_pairing_controller.h"
16 class HostPairingScreen
18 public pairing_chromeos::HostPairingController::Observer
,
19 public HostPairingScreenActor::Delegate
{
23 virtual ~Delegate() {}
25 // Called when a configuration has been received, and should be applied to
27 virtual void ConfigureHostRequested(bool accepted_eula
,
28 const std::string
& lang
,
29 const std::string
& timezone
,
31 const std::string
& keyboard_layout
) = 0;
33 // Called when a network configuration has been received, and should be
34 // used on this device.
35 virtual void AddNetworkRequested(const std::string
& onc_spec
) = 0;
38 HostPairingScreen(BaseScreenDelegate
* base_screen_delegate
,
40 HostPairingScreenActor
* actor
,
41 pairing_chromeos::HostPairingController
* remora_controller
);
42 ~HostPairingScreen() override
;
45 typedef pairing_chromeos::HostPairingController::Stage Stage
;
47 void CommitContextChanges();
49 // Overridden from BaseScreen:
50 void PrepareToShow() override
;
53 std::string
GetName() const override
;
55 // pairing_chromeos::HostPairingController::Observer:
56 void PairingStageChanged(Stage new_stage
) override
;
57 void ConfigureHostRequested(bool accepted_eula
,
58 const std::string
& lang
,
59 const std::string
& timezone
,
61 const std::string
& keyboard_layout
) override
;
62 void AddNetworkRequested(const std::string
& onc_spec
) override
;
63 void EnrollHostRequested(const std::string
& auth_token
) override
;
65 // Overridden from ControllerPairingView::Delegate:
66 void OnActorDestroyed(HostPairingScreenActor
* actor
) override
;
70 HostPairingScreenActor
* actor_
;
72 // Controller performing pairing. Owned by the wizard controller.
73 pairing_chromeos::HostPairingController
* remora_controller_
;
75 // Current stage of pairing process.
78 DISALLOW_COPY_AND_ASSIGN(HostPairingScreen
);
81 } // namespace chromeos
83 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SCREENS_HOST_PAIRING_SCREEN_H_