MSE: Reduce spurious buffered range discontinuities
[chromium-blink-merge.git] / components / pairing / shark_connection_listener.h
blobe2e786b0a7fcdadb746afab9554a19b1a7795ec8
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 COMPONENTS_PAIRING_SHARK_CONNECTION_LISTENER_H_
6 #define COMPONENTS_PAIRING_SHARK_CONNECTION_LISTENER_H_
8 #include <string>
10 #include "base/callback.h"
11 #include "base/macros.h"
12 #include "base/memory/scoped_ptr.h"
13 #include "components/pairing/host_pairing_controller.h"
15 namespace pairing_chromeos {
17 // Listens for incoming connection from shark controller. If connection
18 // is established, invokes callback passing HostPairingController
19 // as an argument.
20 class SharkConnectionListener : public HostPairingController::Observer {
21 public:
22 typedef base::Callback<void(scoped_ptr<HostPairingController>)>
23 OnConnectedCallback;
25 explicit SharkConnectionListener(OnConnectedCallback callback);
26 virtual ~SharkConnectionListener();
28 private:
29 typedef HostPairingController::Stage Stage;
31 // HostPairingController::Observer overrides:
32 virtual void PairingStageChanged(Stage new_stage) OVERRIDE;
33 virtual void ConfigureHost(bool accepted_eula,
34 const std::string& lang,
35 const std::string& timezone,
36 bool send_reports,
37 const std::string& keyboard_layout) OVERRIDE;
38 virtual void EnrollHost(const std::string& auth_token) OVERRIDE;
40 OnConnectedCallback callback_;
41 scoped_ptr<HostPairingController> controller_;
43 DISALLOW_COPY_AND_ASSIGN(SharkConnectionListener);
46 } // namespace pairing_chromeos
48 #endif // COMPONENTS_PAIRING_SHARK_CONNECTION_LISTENER_H_