| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/display_change_observer_chromeos.h" | 5 #include "ash/display/display_change_observer_chromeos.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "ash/ash_switches.h" | 12 #include "ash/ash_switches.h" |
| 13 #include "ash/display/display_info.h" | 13 #include "ash/display/display_info.h" |
| 14 #include "ash/display/display_layout_store.h" | 14 #include "ash/display/display_layout_store.h" |
| 15 #include "ash/display/display_manager.h" | 15 #include "ash/display/display_manager.h" |
| 16 #include "ash/shell.h" | 16 #include "ash/shell.h" |
| 17 #include "ash/touch/touchscreen_util.h" | 17 #include "ash/touch/touchscreen_util.h" |
| 18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
| 19 #include "base/logging.h" | 19 #include "base/logging.h" |
| 20 #include "grit/ash_strings.h" | 20 #include "grit/ash_strings.h" |
| 21 #include "ui/base/l10n/l10n_util.h" | 21 #include "ui/base/l10n/l10n_util.h" |
| 22 #include "ui/compositor/dip_util.h" | 22 #include "ui/compositor/dip_util.h" |
| 23 #include "ui/display/types/chromeos/display_mode.h" | 23 #include "ui/display/types/chromeos/display_mode.h" |
| 24 #include "ui/display/types/chromeos/display_snapshot.h" | 24 #include "ui/display/types/chromeos/display_snapshot.h" |
| 25 #include "ui/display/util/display_util.h" | 25 #include "ui/display/util/display_util.h" |
| 26 #include "ui/events/device_data_manager.h" | 26 #include "ui/events/device_data_manager.h" |
| 27 #include "ui/events/touchscreen_device.h" | 27 #include "ui/events/touchscreen_device.h" |
| 28 #include "ui/gfx/display.h" | 28 #include "ui/gfx/display.h" |
| 29 #include "ui/wm/core/user_activity_detector.h" |
| 29 | 30 |
| 30 namespace ash { | 31 namespace ash { |
| 31 | 32 |
| 32 using ui::DisplayConfigurator; | 33 using ui::DisplayConfigurator; |
| 33 | 34 |
| 34 namespace { | 35 namespace { |
| 35 | 36 |
| 36 // The DPI threshold to determine the device scale factor. | 37 // The DPI threshold to determine the device scale factor. |
| 37 // DPI higher than |dpi| will use |device_scale_factor|. | 38 // DPI higher than |dpi| will use |device_scale_factor|. |
| 38 struct DeviceScaleFactorDPIThreshold { | 39 struct DeviceScaleFactorDPIThreshold { |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 new_info.set_available_color_profiles( | 240 new_info.set_available_color_profiles( |
| 240 Shell::GetInstance() | 241 Shell::GetInstance() |
| 241 ->display_configurator() | 242 ->display_configurator() |
| 242 ->GetAvailableColorCalibrationProfiles(id)); | 243 ->GetAvailableColorCalibrationProfiles(id)); |
| 243 } | 244 } |
| 244 | 245 |
| 245 AssociateTouchscreens( | 246 AssociateTouchscreens( |
| 246 &displays, ui::DeviceDataManager::GetInstance()->touchscreen_devices()); | 247 &displays, ui::DeviceDataManager::GetInstance()->touchscreen_devices()); |
| 247 // DisplayManager can be null during the boot. | 248 // DisplayManager can be null during the boot. |
| 248 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); | 249 Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays); |
| 250 |
| 251 // For the purposes of user activity detection, ignore synthetic mouse events |
| 252 // that are triggered by screen resizes: http://crbug.com/360634 |
| 253 ::wm::UserActivityDetector* user_activity_detector = |
| 254 Shell::GetInstance()->user_activity_detector(); |
| 255 if (user_activity_detector) |
| 256 user_activity_detector->OnDisplayPowerChanging(); |
| 249 } | 257 } |
| 250 | 258 |
| 251 void DisplayChangeObserver::OnAppTerminating() { | 259 void DisplayChangeObserver::OnAppTerminating() { |
| 252 #if defined(USE_ASH) | 260 #if defined(USE_ASH) |
| 253 // Stop handling display configuration events once the shutdown | 261 // Stop handling display configuration events once the shutdown |
| 254 // process starts. crbug.com/177014. | 262 // process starts. crbug.com/177014. |
| 255 Shell::GetInstance()->display_configurator()->PrepareForExit(); | 263 Shell::GetInstance()->display_configurator()->PrepareForExit(); |
| 256 #endif | 264 #endif |
| 257 } | 265 } |
| 258 | 266 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 282 display_infos.push_back(display); | 290 display_infos.push_back(display); |
| 283 } | 291 } |
| 284 | 292 |
| 285 AssociateTouchscreens( | 293 AssociateTouchscreens( |
| 286 &display_infos, | 294 &display_infos, |
| 287 ui::DeviceDataManager::GetInstance()->touchscreen_devices()); | 295 ui::DeviceDataManager::GetInstance()->touchscreen_devices()); |
| 288 display_manager->OnNativeDisplaysChanged(display_infos); | 296 display_manager->OnNativeDisplaysChanged(display_infos); |
| 289 } | 297 } |
| 290 | 298 |
| 291 } // namespace ash | 299 } // namespace ash |
| OLD | NEW |