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/screen/public/screen_manager.h" | 7 #include "athena/screen/public/screen_manager.h" |
8 #include "athena/system/background_controller.h" | 8 #include "athena/system/background_controller.h" |
9 #include "athena/system/orientation_controller.h" | 9 #include "athena/system/orientation_controller.h" |
10 #include "athena/system/shutdown_dialog.h" | 10 #include "athena/system/power_button_controller.h" |
11 #include "athena/system/status_icon_container_view.h" | 11 #include "athena/system/status_icon_container_view.h" |
12 #include "athena/system/time_view.h" | 12 #include "athena/system/time_view.h" |
13 #include "athena/util/container_priorities.h" | 13 #include "athena/util/container_priorities.h" |
14 #include "athena/util/fill_layout_manager.h" | 14 #include "athena/util/fill_layout_manager.h" |
15 #include "base/logging.h" | 15 #include "base/logging.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/views/view.h" | 19 #include "ui/views/view.h" |
20 | 20 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 system_modal_container_ = | 99 system_modal_container_ = |
100 screen_manager->CreateContainer(system_modal_params); | 100 screen_manager->CreateContainer(system_modal_params); |
101 login_screen_system_modal_container_ = screen_manager->CreateContainer( | 101 login_screen_system_modal_container_ = screen_manager->CreateContainer( |
102 ScreenManager::ContainerParams("AthenaLoginScreenSystemModalContainer", | 102 ScreenManager::ContainerParams("AthenaLoginScreenSystemModalContainer", |
103 CP_LOGIN_SCREEN_SYSTEM_MODAL)); | 103 CP_LOGIN_SCREEN_SYSTEM_MODAL)); |
104 | 104 |
105 // Use |login_screen_system_modal_container_| for the power button's dialog | 105 // Use |login_screen_system_modal_container_| for the power button's dialog |
106 // because it needs to show over the login screen. | 106 // because it needs to show over the login screen. |
107 // TODO(pkotwicz): Pick the most appropriate container based on whether the | 107 // TODO(pkotwicz): Pick the most appropriate container based on whether the |
108 // user has logged in. | 108 // user has logged in. |
109 shutdown_dialog_.reset( | 109 power_button_controller_.reset( |
110 new ShutdownDialog(login_screen_system_modal_container_)); | 110 new PowerButtonController(login_screen_system_modal_container_)); |
111 background_controller_.reset( | 111 background_controller_.reset( |
112 new BackgroundController(background_container_)); | 112 new BackgroundController(background_container_)); |
113 } | 113 } |
114 | 114 |
115 virtual void SetBackgroundImage(const gfx::ImageSkia& image) override { | 115 virtual void SetBackgroundImage(const gfx::ImageSkia& image) override { |
116 background_controller_->SetImage(image); | 116 background_controller_->SetImage(image); |
117 } | 117 } |
118 | 118 |
119 virtual views::View* CreateSystemInfoView(ColorScheme color_scheme) override { | 119 virtual views::View* CreateSystemInfoView(ColorScheme color_scheme) override { |
120 return new SystemInfoView(color_scheme, system_modal_container_); | 120 return new SystemInfoView(color_scheme, system_modal_container_); |
121 } | 121 } |
122 | 122 |
123 private: | 123 private: |
124 scoped_ptr<OrientationController> orientation_controller_; | 124 scoped_ptr<OrientationController> orientation_controller_; |
125 scoped_ptr<ShutdownDialog> shutdown_dialog_; | 125 scoped_ptr<PowerButtonController> power_button_controller_; |
126 scoped_ptr<BackgroundController> background_controller_; | 126 scoped_ptr<BackgroundController> background_controller_; |
127 | 127 |
128 // The parent container for the background. | 128 // The parent container for the background. |
129 aura::Window* background_container_; | 129 aura::Window* background_container_; |
130 | 130 |
131 // The parent container used by system modal dialogs. | 131 // The parent container used by system modal dialogs. |
132 aura::Window* system_modal_container_; | 132 aura::Window* system_modal_container_; |
133 | 133 |
134 // The parent container used by system modal dialogs when the login screen is | 134 // The parent container used by system modal dialogs when the login screen is |
135 // visible. | 135 // visible. |
(...skipping 20 matching lines...) Expand all Loading... |
156 } | 156 } |
157 | 157 |
158 // static | 158 // static |
159 void SystemUI::Shutdown() { | 159 void SystemUI::Shutdown() { |
160 CHECK(instance); | 160 CHECK(instance); |
161 delete instance; | 161 delete instance; |
162 instance = NULL; | 162 instance = NULL; |
163 } | 163 } |
164 | 164 |
165 } // namespace athena | 165 } // namespace athena |
OLD | NEW |