| 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 "ui/display/manager/chromeos/display_change_observer.h" | 5 #include "ui/display/manager/chromeos/display_change_observer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 | 286 |
| 287 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { | 287 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { |
| 288 // If there are no cached display snapshots, either there are no attached | 288 // If there are no cached display snapshots, either there are no attached |
| 289 // displays or the cached snapshots have been invalidated. For the first case | 289 // displays or the cached snapshots have been invalidated. For the first case |
| 290 // there aren't any touchscreens to associate. For the second case, the | 290 // there aren't any touchscreens to associate. For the second case, the |
| 291 // displays and touch input-devices will get associated when display | 291 // displays and touch input-devices will get associated when display |
| 292 // configuration finishes. | 292 // configuration finishes. |
| 293 const auto& cached_displays = display_configurator_->cached_displays(); | 293 const auto& cached_displays = display_configurator_->cached_displays(); |
| 294 if (!cached_displays.empty()) | 294 if (!cached_displays.empty()) |
| 295 OnDisplayModeChanged(cached_displays); | 295 OnDisplayModeChanged(cached_displays); |
| 296 else | |
| 297 VLOG(1) << "Not updating touchscreen associations"; | |
| 298 } | 296 } |
| 299 | 297 |
| 300 // static | 298 // static |
| 301 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { | 299 float DisplayChangeObserver::FindDeviceScaleFactor(float dpi) { |
| 302 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) { | 300 for (size_t i = 0; i < arraysize(kThresholdTable); ++i) { |
| 303 if (dpi > kThresholdTable[i].dpi) | 301 if (dpi > kThresholdTable[i].dpi) |
| 304 return kThresholdTable[i].device_scale_factor; | 302 return kThresholdTable[i].device_scale_factor; |
| 305 } | 303 } |
| 306 return 1.0f; | 304 return 1.0f; |
| 307 } | 305 } |
| 308 | 306 |
| 309 } // namespace display | 307 } // namespace display |
| OLD | NEW |