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

Side by Side Diff: ash/touch/touch_hud_debug.cc

Issue 259253002: Add OnDisplayMetricsChanged in DisplayObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@update_orientation
Patch Set: Created 6 years, 7 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 unified diff | Download patch
« no previous file with comments | « ash/touch/touch_hud_debug.h ('k') | ash/touch/touch_observer_hud.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/touch/touch_hud_debug.h ('k') | ash/touch/touch_observer_hud.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698