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

Unified Diff: ash/touch/touch_transformer_controller.cc

Issue 336863002: Moving input device hotplug event processing outside of ui/display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove TouchscreenDelegate references from display_unittests 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/touch/touchscreen_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/touch/touch_transformer_controller.cc
diff --git a/ash/touch/touch_transformer_controller.cc b/ash/touch/touch_transformer_controller.cc
index 828a47b5c9a06bbf32355ce316f4c8559e95bb4d..8db1fa12a2479befc1280d61a7b7448d9b4c0d0d 100644
--- a/ash/touch/touch_transformer_controller.cc
+++ b/ash/touch/touch_transformer_controller.cc
@@ -25,7 +25,6 @@ DisplayManager* GetDisplayManager() {
} // namespace
-
// This is to compute the scale ratio for the TouchEvent's radius. The
// configured resolution of the display is not always the same as the touch
// screen's reporting resolution, e.g. the display could be set as
@@ -96,18 +95,20 @@ bool TouchTransformerController::ShouldComputeMirrorModeTouchTransformer(
if (touch_display.touch_device_id() == 0)
return false;
- const ui::DisplayConfigurator::DisplayState* state = NULL;
- const std::vector<ui::DisplayConfigurator::DisplayState>& cached_displays =
- Shell::GetInstance()->display_configurator()->cached_displays();
- for (size_t i = 0; i < cached_displays.size(); i++) {
- if (cached_displays[i].touch_device_id == touch_display.touch_device_id()) {
- state = &cached_displays[i];
+ DisplayManager* display_manager = Shell::GetInstance()->display_manager();
+ const std::vector<gfx::Display>& displays = display_manager->displays();
+ const DisplayInfo* info = NULL;
+ for (size_t i = 0; i < displays.size(); i++) {
+ const DisplayInfo& current_info =
+ display_manager->GetDisplayInfo(displays[i].id());
+ if (current_info.touch_device_id() == touch_display.touch_device_id()) {
+ info = &current_info;
break;
}
}
- if (!state || state->mirror_mode == state->display->native_mode() ||
- !state->display->is_aspect_preserving_scaling()) {
+ if (!info || info->size_in_pixel() == info->GetNativeModeSize() ||
+ !info->is_aspect_preserving_scaling()) {
return false;
}
return true;
« no previous file with comments | « ash/display/display_info.cc ('k') | ash/touch/touchscreen_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698