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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 void TouchCalibratorView::InitViewContents() { | 496 void TouchCalibratorView::InitViewContents() { |
497 // Initialize the background rect. | 497 // Initialize the background rect. |
498 background_rect_ = | 498 background_rect_ = |
499 gfx::RectF(0, 0, display_.bounds().width(), display_.bounds().height()); | 499 gfx::RectF(0, 0, display_.bounds().width(), display_.bounds().height()); |
500 | 500 |
501 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 501 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
502 // Initialize exit label that informs the user how to exit the touch | 502 // Initialize exit label that informs the user how to exit the touch |
503 // calibration setup. | 503 // calibration setup. |
504 exit_label_ = new views::Label( | 504 exit_label_ = new views::Label( |
505 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_EXIT_LABEL), | 505 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_EXIT_LABEL), |
506 rb.GetFontListWithDelta(8, gfx::Font::FontStyle::NORMAL, | 506 {rb.GetFontListWithDelta(8, gfx::Font::FontStyle::NORMAL, |
507 gfx::Font::Weight::NORMAL)); | 507 gfx::Font::Weight::NORMAL)}); |
508 exit_label_->SetBounds((display_.bounds().width() - kExitLabelWidth) / 2, | 508 exit_label_->SetBounds((display_.bounds().width() - kExitLabelWidth) / 2, |
509 display_.bounds().height() * 3.f / 4, kExitLabelWidth, | 509 display_.bounds().height() * 3.f / 4, kExitLabelWidth, |
510 kExitLabelHeight); | 510 kExitLabelHeight); |
511 exit_label_->SetAutoColorReadabilityEnabled(false); | 511 exit_label_->SetAutoColorReadabilityEnabled(false); |
512 exit_label_->SetEnabledColor(kExitLabelColor); | 512 exit_label_->SetEnabledColor(kExitLabelColor); |
513 exit_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 513 exit_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
514 exit_label_->SetSubpixelRenderingEnabled(false); | 514 exit_label_->SetSubpixelRenderingEnabled(false); |
515 exit_label_->SetVisible(false); | 515 exit_label_->SetVisible(false); |
516 | 516 |
517 AddChildView(exit_label_); | 517 AddChildView(exit_label_); |
(...skipping 11 matching lines...) Expand all Loading... |
529 | 529 |
530 throbber_circle_ = | 530 throbber_circle_ = |
531 new CircularThrobberView(kThrobberCircleViewWidth, kInnerCircleColor, | 531 new CircularThrobberView(kThrobberCircleViewWidth, kInnerCircleColor, |
532 kOuterCircleColor, kCircleAnimationDurationMs); | 532 kOuterCircleColor, kCircleAnimationDurationMs); |
533 throbber_circle_->SetPosition( | 533 throbber_circle_->SetPosition( |
534 gfx::Point(kThrobberCircleViewHorizontalOffset, 0)); | 534 gfx::Point(kThrobberCircleViewHorizontalOffset, 0)); |
535 | 535 |
536 // Initialize the tap label. | 536 // Initialize the tap label. |
537 tap_label_ = new views::Label( | 537 tap_label_ = new views::Label( |
538 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_TAP_HERE_LABEL), | 538 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_TAP_HERE_LABEL), |
539 rb.GetFontListWithDelta(6, gfx::Font::FontStyle::NORMAL, | 539 {rb.GetFontListWithDelta(6, gfx::Font::FontStyle::NORMAL, |
540 gfx::Font::Weight::NORMAL)); | 540 gfx::Font::Weight::NORMAL)}); |
541 tap_label_->SetBounds(0, kThrobberCircleViewWidth, kTapLabelWidth, | 541 tap_label_->SetBounds(0, kThrobberCircleViewWidth, kTapLabelWidth, |
542 kTapLabelHeight); | 542 kTapLabelHeight); |
543 tap_label_->SetEnabledColor(kTapHereLabelColor); | 543 tap_label_->SetEnabledColor(kTapHereLabelColor); |
544 tap_label_->SetDisabledColor(kTapHereLabelColor); | 544 tap_label_->SetDisabledColor(kTapHereLabelColor); |
545 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); | 545 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); |
546 tap_label_->SetAutoColorReadabilityEnabled(false); | 546 tap_label_->SetAutoColorReadabilityEnabled(false); |
547 tap_label_->SetSubpixelRenderingEnabled(false); | 547 tap_label_->SetSubpixelRenderingEnabled(false); |
548 tap_label_->SetVisible(false); | 548 tap_label_->SetVisible(false); |
549 | 549 |
550 touch_point_view_ = new views::View; | 550 touch_point_view_ = new views::View; |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
824 void TouchCalibratorView::SkipCurrentAnimation() { | 824 void TouchCalibratorView::SkipCurrentAnimation() { |
825 if (animator_->is_animating()) | 825 if (animator_->is_animating()) |
826 animator_->End(); | 826 animator_->End(); |
827 if (touch_point_view_ && | 827 if (touch_point_view_ && |
828 touch_point_view_->layer()->GetAnimator()->is_animating()) { | 828 touch_point_view_->layer()->GetAnimator()->is_animating()) { |
829 touch_point_view_->layer()->GetAnimator()->StopAnimating(); | 829 touch_point_view_->layer()->GetAnimator()->StopAnimating(); |
830 } | 830 } |
831 } | 831 } |
832 | 832 |
833 } // namespace chromeos | 833 } // namespace chromeos |
OLD | NEW |