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 "ash/display/screen_ash.h" | 5 #include "ash/display/screen_ash.h" |
6 | 6 |
| 7 #include "ash/ash_switches.h" |
7 #include "ash/display/window_tree_host_manager.h" | 8 #include "ash/display/window_tree_host_manager.h" |
8 #include "ash/root_window_controller.h" | 9 #include "ash/root_window_controller.h" |
9 #include "ash/root_window_settings.h" | 10 #include "ash/root_window_settings.h" |
10 #include "ash/shelf/shelf_widget.h" | 11 #include "ash/shelf/shelf_widget.h" |
11 #include "ash/shell.h" | 12 #include "ash/shell.h" |
12 #include "ash/wm/root_window_finder.h" | 13 #include "ash/wm/root_window_finder.h" |
| 14 #include "base/command_line.h" |
13 #include "base/logging.h" | 15 #include "base/logging.h" |
14 #include "ui/aura/client/screen_position_client.h" | 16 #include "ui/aura/client/screen_position_client.h" |
15 #include "ui/aura/env.h" | 17 #include "ui/aura/env.h" |
16 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
17 #include "ui/aura/window_event_dispatcher.h" | 19 #include "ui/aura/window_event_dispatcher.h" |
18 #include "ui/display/display.h" | 20 #include "ui/display/display.h" |
19 #include "ui/display/display_finder.h" | 21 #include "ui/display/display_finder.h" |
20 #include "ui/display/manager/display_manager.h" | 22 #include "ui/display/manager/display_manager.h" |
21 #include "ui/display/screen.h" | 23 #include "ui/display/screen.h" |
22 #include "ui/display/types/display_constants.h" | 24 #include "ui/display/types/display_constants.h" |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 179 |
178 // static | 180 // static |
179 display::DisplayManager* ScreenAsh::CreateDisplayManager() { | 181 display::DisplayManager* ScreenAsh::CreateDisplayManager() { |
180 std::unique_ptr<ScreenAsh> screen(new ScreenAsh); | 182 std::unique_ptr<ScreenAsh> screen(new ScreenAsh); |
181 | 183 |
182 display::Screen* current = display::Screen::GetScreen(); | 184 display::Screen* current = display::Screen::GetScreen(); |
183 // If there is no native, or the native was for shutdown, | 185 // If there is no native, or the native was for shutdown, |
184 // use ash's screen. | 186 // use ash's screen. |
185 if (!current || current == screen_for_shutdown) | 187 if (!current || current == screen_for_shutdown) |
186 display::Screen::SetScreenInstance(screen.get()); | 188 display::Screen::SetScreenInstance(screen.get()); |
187 return new display::DisplayManager(std::move(screen)); | 189 display::DisplayManager* manager = |
| 190 new display::DisplayManager(std::move(screen)); |
| 191 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 192 switches::kAshEnableTouchView)) { |
| 193 manager->set_internal_display_has_accelerometer(true); |
| 194 } |
| 195 return manager; |
188 } | 196 } |
189 | 197 |
190 // static | 198 // static |
191 void ScreenAsh::CreateScreenForShutdown() { | 199 void ScreenAsh::CreateScreenForShutdown() { |
192 delete screen_for_shutdown; | 200 delete screen_for_shutdown; |
193 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); | 201 screen_for_shutdown = new ScreenForShutdown(display::Screen::GetScreen()); |
194 display::Screen::SetScreenInstance(screen_for_shutdown); | 202 display::Screen::SetScreenInstance(screen_for_shutdown); |
195 } | 203 } |
196 | 204 |
197 } // namespace ash | 205 } // namespace ash |
OLD | NEW |