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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 const gfx::Size& display_size = display.size(); | 345 const gfx::Size& display_size = display.size(); |
346 canvas_->SetSize(display_size); | 346 canvas_->SetSize(display_size); |
347 | 347 |
348 label_container_ = new views::View; | 348 label_container_ = new views::View; |
349 label_container_->SetLayoutManager(new views::BoxLayout( | 349 label_container_->SetLayoutManager(new views::BoxLayout( |
350 views::BoxLayout::kVertical, 0, 0, 0)); | 350 views::BoxLayout::kVertical, 0, 0, 0)); |
351 | 351 |
352 for (int i = 0; i < kMaxTouchPoints; ++i) { | 352 for (int i = 0; i < kMaxTouchPoints; ++i) { |
353 touch_labels_[i] = new views::Label; | 353 touch_labels_[i] = new views::Label; |
354 touch_labels_[i]->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); | 354 touch_labels_[i]->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); |
355 touch_labels_[i]->set_shadows(gfx::ShadowValues(1, | 355 touch_labels_[i]->SetShadows(gfx::ShadowValues( |
356 gfx::ShadowValue(gfx::Point(1, 1), 0, SK_ColorWHITE))); | 356 1, gfx::ShadowValue(gfx::Point(1, 1), 0, SK_ColorWHITE))); |
357 label_container_->AddChildView(touch_labels_[i]); | 357 label_container_->AddChildView(touch_labels_[i]); |
358 } | 358 } |
359 label_container_->SetX(0); | 359 label_container_->SetX(0); |
360 label_container_->SetY(display_size.height() / kReducedScale); | 360 label_container_->SetY(display_size.height() / kReducedScale); |
361 label_container_->SetSize(label_container_->GetPreferredSize()); | 361 label_container_->SetSize(label_container_->GetPreferredSize()); |
362 label_container_->SetVisible(false); | 362 label_container_->SetVisible(false); |
363 content->AddChildView(label_container_); | 363 content->AddChildView(label_container_); |
364 } | 364 } |
365 | 365 |
366 TouchHudDebug::~TouchHudDebug() { | 366 TouchHudDebug::~TouchHudDebug() { |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 RootWindowController* controller) { | 479 RootWindowController* controller) { |
480 controller->set_touch_hud_debug(this); | 480 controller->set_touch_hud_debug(this); |
481 } | 481 } |
482 | 482 |
483 void TouchHudDebug::UnsetHudForRootWindowController( | 483 void TouchHudDebug::UnsetHudForRootWindowController( |
484 RootWindowController* controller) { | 484 RootWindowController* controller) { |
485 controller->set_touch_hud_debug(NULL); | 485 controller->set_touch_hud_debug(NULL); |
486 } | 486 } |
487 | 487 |
488 } // namespace ash | 488 } // namespace ash |
OLD | NEW |