| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view
.h" | 5 #include "chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view
.h" |
| 6 | 6 |
| 7 #include "ash/display/window_tree_host_manager.h" | 7 #include "ash/display/window_tree_host_manager.h" |
| 8 #include "ash/public/cpp/shell_window_ids.h" | 8 #include "ash/public/cpp/shell_window_ids.h" |
| 9 #include "ash/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 tap_label_->SetDisabledColor(kTapHereLabelColor); | 449 tap_label_->SetDisabledColor(kTapHereLabelColor); |
| 450 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 450 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
| 451 tap_label_->SetAutoColorReadabilityEnabled(false); | 451 tap_label_->SetAutoColorReadabilityEnabled(false); |
| 452 tap_label_->SetSubpixelRenderingEnabled(false); | 452 tap_label_->SetSubpixelRenderingEnabled(false); |
| 453 tap_label_->SetVisible(false); | 453 tap_label_->SetVisible(false); |
| 454 | 454 |
| 455 touch_point_view_ = new views::View; | 455 touch_point_view_ = new views::View; |
| 456 touch_point_view_->SetBounds(kTouchPointViewOffset, kTouchPointViewOffset, | 456 touch_point_view_->SetBounds(kTouchPointViewOffset, kTouchPointViewOffset, |
| 457 kTapLabelWidth, kTouchPointViewHeight); | 457 kTapLabelWidth, kTouchPointViewHeight); |
| 458 touch_point_view_->SetVisible(false); | 458 touch_point_view_->SetVisible(false); |
| 459 touch_point_view_->SetPaintToLayer(true); | 459 touch_point_view_->SetPaintToLayer(); |
| 460 touch_point_view_->layer()->SetFillsBoundsOpaquely(false); | 460 touch_point_view_->layer()->SetFillsBoundsOpaquely(false); |
| 461 touch_point_view_->layer()->GetAnimator()->AddObserver(this); | 461 touch_point_view_->layer()->GetAnimator()->AddObserver(this); |
| 462 touch_point_view_->set_background( | 462 touch_point_view_->set_background( |
| 463 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); | 463 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); |
| 464 | 464 |
| 465 touch_point_view_->AddChildView(throbber_circle_); | 465 touch_point_view_->AddChildView(throbber_circle_); |
| 466 touch_point_view_->AddChildView(tap_label_); | 466 touch_point_view_->AddChildView(tap_label_); |
| 467 | 467 |
| 468 AddChildView(touch_point_view_); | 468 AddChildView(touch_point_view_); |
| 469 | 469 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 495 base::string16 finish_msg_text = | 495 base::string16 finish_msg_text = |
| 496 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_FINISH_LABEL); | 496 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_FINISH_LABEL); |
| 497 | 497 |
| 498 gfx::Rect msg_view_bounds( | 498 gfx::Rect msg_view_bounds( |
| 499 (display_.bounds().width() - kCompleteMessageViewWidth) / 2, | 499 (display_.bounds().width() - kCompleteMessageViewWidth) / 2, |
| 500 display_.bounds().height() / 3, kCompleteMessageViewWidth, | 500 display_.bounds().height() / 3, kCompleteMessageViewWidth, |
| 501 kCompleteMessageViewHeight); | 501 kCompleteMessageViewHeight); |
| 502 completion_message_view_ = | 502 completion_message_view_ = |
| 503 new CompletionMessageView(msg_view_bounds, finish_msg_text); | 503 new CompletionMessageView(msg_view_bounds, finish_msg_text); |
| 504 completion_message_view_->SetVisible(false); | 504 completion_message_view_->SetVisible(false); |
| 505 completion_message_view_->SetPaintToLayer(true); | 505 completion_message_view_->SetPaintToLayer(); |
| 506 completion_message_view_->layer()->SetFillsBoundsOpaquely(false); | 506 completion_message_view_->layer()->SetFillsBoundsOpaquely(false); |
| 507 completion_message_view_->layer()->GetAnimator()->AddObserver(this); | 507 completion_message_view_->layer()->GetAnimator()->AddObserver(this); |
| 508 completion_message_view_->set_background( | 508 completion_message_view_->set_background( |
| 509 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); | 509 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); |
| 510 | 510 |
| 511 AddChildView(completion_message_view_); | 511 AddChildView(completion_message_view_); |
| 512 } | 512 } |
| 513 | 513 |
| 514 void TouchCalibratorView::OnPaint(gfx::Canvas* canvas) { | 514 void TouchCalibratorView::OnPaint(gfx::Canvas* canvas) { |
| 515 OnPaintBackground(canvas); | 515 OnPaintBackground(canvas); |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 717 void TouchCalibratorView::SkipCurrentAnimation() { | 717 void TouchCalibratorView::SkipCurrentAnimation() { |
| 718 if (animator_->is_animating()) | 718 if (animator_->is_animating()) |
| 719 animator_->End(); | 719 animator_->End(); |
| 720 if (touch_point_view_ && | 720 if (touch_point_view_ && |
| 721 touch_point_view_->layer()->GetAnimator()->is_animating()) { | 721 touch_point_view_->layer()->GetAnimator()->is_animating()) { |
| 722 touch_point_view_->layer()->GetAnimator()->StopAnimating(); | 722 touch_point_view_->layer()->GetAnimator()->StopAnimating(); |
| 723 } | 723 } |
| 724 } | 724 } |
| 725 | 725 |
| 726 } // namespace chromeos | 726 } // namespace chromeos |
| OLD | NEW |