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/touch/touch_hud_debug.h" | 5 #include "ash/touch/touch_hud_debug.h" |
6 | 6 |
7 #include "ash/display/display_manager.h" | 7 #include "ash/display/display_manager.h" |
8 #include "ash/root_window_controller.h" | 8 #include "ash/root_window_controller.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
458 void TouchHudDebug::OnTouchEvent(ui::TouchEvent* event) { | 458 void TouchHudDebug::OnTouchEvent(ui::TouchEvent* event) { |
459 if (event->touch_id() >= kMaxTouchPoints) | 459 if (event->touch_id() >= kMaxTouchPoints) |
460 return; | 460 return; |
461 | 461 |
462 touch_log_->AddTouchPoint(*event); | 462 touch_log_->AddTouchPoint(*event); |
463 canvas_->TouchPointAdded(event->touch_id()); | 463 canvas_->TouchPointAdded(event->touch_id()); |
464 UpdateTouchPointLabel(event->touch_id()); | 464 UpdateTouchPointLabel(event->touch_id()); |
465 label_container_->SetSize(label_container_->GetPreferredSize()); | 465 label_container_->SetSize(label_container_->GetPreferredSize()); |
466 } | 466 } |
467 | 467 |
468 void TouchHudDebug::OnDisplayMetricsChanged(const gfx::Display& display, | 468 void TouchHudDebug::OnDisplayBoundsChanged(const gfx::Display& display) { |
469 uint32_t metrics) { | 469 TouchObserverHUD::OnDisplayBoundsChanged(display); |
470 TouchObserverHUD::OnDisplayMetricsChanged(display, metrics); | |
471 | 470 |
472 if (display.id() != display_id() || !(metrics & DISPLAY_METRIC_BOUNDS)) | 471 if (display.id() != display_id()) |
473 return; | 472 return; |
474 const gfx::Size& size = display.size(); | 473 const gfx::Size& size = display.size(); |
475 canvas_->SetSize(size); | 474 canvas_->SetSize(size); |
476 label_container_->SetY(size.height() / kReducedScale); | 475 label_container_->SetY(size.height() / kReducedScale); |
477 } | 476 } |
478 | 477 |
479 void TouchHudDebug::SetHudForRootWindowController( | 478 void TouchHudDebug::SetHudForRootWindowController( |
480 RootWindowController* controller) { | 479 RootWindowController* controller) { |
481 controller->set_touch_hud_debug(this); | 480 controller->set_touch_hud_debug(this); |
482 } | 481 } |
483 | 482 |
484 void TouchHudDebug::UnsetHudForRootWindowController( | 483 void TouchHudDebug::UnsetHudForRootWindowController( |
485 RootWindowController* controller) { | 484 RootWindowController* controller) { |
486 controller->set_touch_hud_debug(NULL); | 485 controller->set_touch_hud_debug(NULL); |
487 } | 486 } |
488 | 487 |
489 } // namespace ash | 488 } // namespace ash |
OLD | NEW |