| Index: ash/touch/touch_transformer_controller_ozone.cc
|
| diff --git a/ash/touch/touch_transformer_controller_ozone.cc b/ash/touch/touch_transformer_controller_ozone.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..d0e2e9df4189075e2f90a5f9b061b16351760436
|
| --- /dev/null
|
| +++ b/ash/touch/touch_transformer_controller_ozone.cc
|
| @@ -0,0 +1,47 @@
|
| +// Copyright 2014 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/touch/touch_transformer_controller.h"
|
| +
|
| +#include "ash/display/display_manager.h"
|
| +#include "ash/shell.h"
|
| +#include "ui/events/device_data_manager.h"
|
| +
|
| +namespace ash {
|
| +
|
| +TouchTransformerController::TouchTransformerController()
|
| + : force_compute_mirror_mode_touch_transformer_(false) {
|
| + Shell::GetInstance()->display_controller()->AddObserver(this);
|
| +}
|
| +
|
| +TouchTransformerController::~TouchTransformerController() {
|
| + Shell::GetInstance()->display_controller()->RemoveObserver(this);
|
| +}
|
| +
|
| +void TouchTransformerController::UpdateTouchTransformer() const {
|
| + ui::DeviceDataManager* device_manager = ui::DeviceDataManager::GetInstance();
|
| + device_manager->ClearTouchTransformerRecord();
|
| +
|
| + DisplayManager* display_manager = Shell::GetInstance()->display_manager();
|
| + const std::vector<gfx::Display>& displays = display_manager->displays();
|
| + for (size_t i = 0; i < displays.size(); ++i) {
|
| + DisplayInfo display = display_manager->GetDisplayInfo(displays[i].id());
|
| + if (display.touch_support() != gfx::Display::TOUCH_SUPPORT_AVAILABLE)
|
| + continue;
|
| +
|
| + // On Ozone we only care about the display <-> touchscreen mapping.
|
| + device_manager->UpdateTouchInfoForDisplay(
|
| + display.id(), display.touch_device_id(), gfx::Transform());
|
| + }
|
| +}
|
| +
|
| +void TouchTransformerController::OnDisplaysInitialized() {
|
| + UpdateTouchTransformer();
|
| +}
|
| +
|
| +void TouchTransformerController::OnDisplayConfigurationChanged() {
|
| + UpdateTouchTransformer();
|
| +}
|
| +
|
| +} // namespace ash
|
|
|