OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "athena/system/public/system_ui.h" | 5 #include "athena/system/public/system_ui.h" |
6 | 6 |
| 7 #include "athena/system/orientation_controller.h" |
7 #include "athena/system/power_button_controller.h" | 8 #include "athena/system/power_button_controller.h" |
8 #include "base/logging.h" | 9 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 | 11 |
11 namespace athena { | 12 namespace athena { |
12 namespace { | 13 namespace { |
13 | 14 |
14 SystemUI* instance = NULL; | 15 SystemUI* instance = NULL; |
15 | 16 |
16 class SystemUIImpl : public SystemUI { | 17 class SystemUIImpl : public SystemUI { |
17 public: | 18 public: |
18 SystemUIImpl() : power_button_controller_(new PowerButtonController) { | 19 SystemUIImpl() : orientation_controller_(new OrientationController), |
| 20 power_button_controller_(new PowerButtonController) { |
19 } | 21 } |
20 | 22 |
21 virtual ~SystemUIImpl() { | 23 virtual ~SystemUIImpl() { |
22 } | 24 } |
23 | 25 |
24 private: | 26 private: |
| 27 scoped_ptr<OrientationController> orientation_controller_; |
25 scoped_ptr<PowerButtonController> power_button_controller_; | 28 scoped_ptr<PowerButtonController> power_button_controller_; |
26 | 29 |
27 DISALLOW_COPY_AND_ASSIGN(SystemUIImpl); | 30 DISALLOW_COPY_AND_ASSIGN(SystemUIImpl); |
28 }; | 31 }; |
29 | 32 |
30 } // namespace | 33 } // namespace |
31 | 34 |
32 // static | 35 // static |
33 SystemUI* SystemUI::Create() { | 36 SystemUI* SystemUI::Create() { |
34 instance = new SystemUIImpl; | 37 instance = new SystemUIImpl; |
35 return instance; | 38 return instance; |
36 } | 39 } |
37 | 40 |
38 // static | 41 // static |
39 void SystemUI::Shutdown() { | 42 void SystemUI::Shutdown() { |
40 CHECK(instance); | 43 CHECK(instance); |
41 delete instance; | 44 delete instance; |
42 instance = NULL; | 45 instance = NULL; |
43 } | 46 } |
44 | 47 |
45 } // namespace athena | 48 } // namespace athena |
OLD | NEW |