Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Side by Side Diff: athena/system/system_ui_impl.cc

Issue 574113002: Use chromeos accelerometer reader and support only lid accelerometer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/device_socket_listener.h"
10 #include "athena/system/orientation_controller.h" 9 #include "athena/system/orientation_controller.h"
11 #include "athena/system/power_button_controller.h" 10 #include "athena/system/power_button_controller.h"
12 #include "athena/system/status_icon_container_view.h" 11 #include "athena/system/status_icon_container_view.h"
13 #include "athena/system/time_view.h" 12 #include "athena/system/time_view.h"
14 #include "athena/util/container_priorities.h" 13 #include "athena/util/container_priorities.h"
15 #include "athena/util/fill_layout_manager.h" 14 #include "athena/util/fill_layout_manager.h"
16 #include "base/logging.h" 15 #include "base/logging.h"
17 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
18 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
19 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 105
107 virtual void SetBackgroundImage(const gfx::ImageSkia& image) OVERRIDE { 106 virtual void SetBackgroundImage(const gfx::ImageSkia& image) OVERRIDE {
108 background_controller_->SetImage(image); 107 background_controller_->SetImage(image);
109 } 108 }
110 109
111 virtual views::View* CreateSystemInfoView(ColorScheme color_scheme) OVERRIDE { 110 virtual views::View* CreateSystemInfoView(ColorScheme color_scheme) OVERRIDE {
112 return new SystemInfoView(color_scheme, system_modal_container_); 111 return new SystemInfoView(color_scheme, system_modal_container_);
113 } 112 }
114 113
115 private: 114 private:
116 scoped_refptr<OrientationController> orientation_controller_; 115 scoped_ptr<OrientationController> orientation_controller_;
117 scoped_ptr<PowerButtonController> power_button_controller_; 116 scoped_ptr<PowerButtonController> power_button_controller_;
118 scoped_ptr<BackgroundController> background_controller_; 117 scoped_ptr<BackgroundController> background_controller_;
119 118
120 // The parent container for the background. 119 // The parent container for the background.
121 aura::Window* background_container_; 120 aura::Window* background_container_;
122 121
123 // The parent container used by the "select network" dialog. 122 // The parent container used by the "select network" dialog.
124 aura::Window* system_modal_container_; 123 aura::Window* system_modal_container_;
125 124
126 DISALLOW_COPY_AND_ASSIGN(SystemUIImpl); 125 DISALLOW_COPY_AND_ASSIGN(SystemUIImpl);
127 }; 126 };
128 127
129 } // namespace 128 } // namespace
130 129
131 // static 130 // static
132 SystemUI* SystemUI::Create(scoped_refptr<base::TaskRunner> file_task_runner) { 131 SystemUI* SystemUI::Create(scoped_refptr<base::TaskRunner> file_task_runner) {
133 DeviceSocketListener::CreateSocketManager(file_task_runner);
134 SystemUIImpl* system_ui = new SystemUIImpl(file_task_runner); 132 SystemUIImpl* system_ui = new SystemUIImpl(file_task_runner);
135 instance = system_ui; 133 instance = system_ui;
136 system_ui->Init(); 134 system_ui->Init();
137 return instance; 135 return instance;
138 } 136 }
139 137
140 // static 138 // static
141 SystemUI* SystemUI::Get() { 139 SystemUI* SystemUI::Get() {
142 DCHECK(instance); 140 DCHECK(instance);
143 return instance; 141 return instance;
144 } 142 }
145 143
146 // static 144 // static
147 void SystemUI::Shutdown() { 145 void SystemUI::Shutdown() {
148 CHECK(instance); 146 CHECK(instance);
149 delete instance; 147 delete instance;
150 instance = NULL; 148 instance = NULL;
151 DeviceSocketListener::ShutdownSocketManager();
152 } 149 }
153 150
154 } // namespace athena 151 } // namespace athena
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698