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 #include "athena/system/public/system_ui.h"
7 #include "athena/system/device_socket_listener.h"
8 #include "athena/system/orientation_controller.h"
9 #include "athena/system/power_button_controller.h"
10 #include "base/logging.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h"
17 SystemUI* instance = NULL;
19 class SystemUIImpl : public SystemUI {
21 SystemUIImpl(scoped_refptr<base::TaskRunner> io_task_runner)
22 : orientation_controller_(new OrientationController(io_task_runner)),
23 power_button_controller_(new PowerButtonController) {
26 virtual ~SystemUIImpl() {
30 scoped_refptr<OrientationController> orientation_controller_;
31 scoped_ptr<PowerButtonController> power_button_controller_;
33 DISALLOW_COPY_AND_ASSIGN(SystemUIImpl);
39 SystemUI* SystemUI::Create(
40 scoped_refptr<base::TaskRunner> io_task_runner) {
41 DeviceSocketListener::CreateSocketManager(io_task_runner);
42 instance = new SystemUIImpl(io_task_runner);
47 void SystemUI::Shutdown() {
51 DeviceSocketListener::ShutdownSocketManager();