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::OnDisplayBoundsChanged(const gfx::Display& display) { | 468 void TouchHudDebug::OnDisplayMetricsChanged(const gfx::Display& display, |
469 TouchObserverHUD::OnDisplayBoundsChanged(display); | 469 uint32_t metrics) { |
| 470 TouchObserverHUD::OnDisplayMetricsChanged(display, metrics); |
470 | 471 |
471 if (display.id() != display_id()) | 472 if (display.id() != display_id() || !(metrics & DISPLAY_METRIC_BOUNDS)) |
472 return; | 473 return; |
473 const gfx::Size& size = display.size(); | 474 const gfx::Size& size = display.size(); |
474 canvas_->SetSize(size); | 475 canvas_->SetSize(size); |
475 label_container_->SetY(size.height() / kReducedScale); | 476 label_container_->SetY(size.height() / kReducedScale); |
476 } | 477 } |
477 | 478 |
478 void TouchHudDebug::SetHudForRootWindowController( | 479 void TouchHudDebug::SetHudForRootWindowController( |
479 RootWindowController* controller) { | 480 RootWindowController* controller) { |
480 controller->set_touch_hud_debug(this); | 481 controller->set_touch_hud_debug(this); |
481 } | 482 } |
482 | 483 |
483 void TouchHudDebug::UnsetHudForRootWindowController( | 484 void TouchHudDebug::UnsetHudForRootWindowController( |
484 RootWindowController* controller) { | 485 RootWindowController* controller) { |
485 controller->set_touch_hud_debug(NULL); | 486 controller->set_touch_hud_debug(NULL); |
486 } | 487 } |
487 | 488 |
488 } // namespace ash | 489 } // namespace ash |
OLD | NEW |