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

Side by Side Diff: chrome/browser/chromeos/display/touch_calibrator/touch_calibrator_view.cc

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: Refactor Created 3 years, 11 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
OLDNEW
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"
11 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
12 #include "ui/base/resource/resource_bundle.h" 12 #include "ui/base/resource/resource_bundle.h"
13 #include "ui/compositor/layer_type.h"
13 #include "ui/compositor/scoped_layer_animation_settings.h" 14 #include "ui/compositor/scoped_layer_animation_settings.h"
14 #include "ui/gfx/animation/linear_animation.h" 15 #include "ui/gfx/animation/linear_animation.h"
15 #include "ui/gfx/animation/throb_animation.h" 16 #include "ui/gfx/animation/throb_animation.h"
16 #include "ui/gfx/canvas.h" 17 #include "ui/gfx/canvas.h"
17 #include "ui/gfx/paint_vector_icon.h" 18 #include "ui/gfx/paint_vector_icon.h"
18 #include "ui/strings/grit/ui_strings.h" 19 #include "ui/strings/grit/ui_strings.h"
19 #include "ui/views/background.h" 20 #include "ui/views/background.h"
20 #include "ui/views/controls/label.h" 21 #include "ui/views/controls/label.h"
21 #include "ui/views/widget/widget.h" 22 #include "ui/views/widget/widget.h"
22 23
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 tap_label_->SetDisabledColor(kTapHereLabelColor); 450 tap_label_->SetDisabledColor(kTapHereLabelColor);
450 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER); 451 tap_label_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
451 tap_label_->SetAutoColorReadabilityEnabled(false); 452 tap_label_->SetAutoColorReadabilityEnabled(false);
452 tap_label_->SetSubpixelRenderingEnabled(false); 453 tap_label_->SetSubpixelRenderingEnabled(false);
453 tap_label_->SetVisible(false); 454 tap_label_->SetVisible(false);
454 455
455 touch_point_view_ = new views::View; 456 touch_point_view_ = new views::View;
456 touch_point_view_->SetBounds(kTouchPointViewOffset, kTouchPointViewOffset, 457 touch_point_view_->SetBounds(kTouchPointViewOffset, kTouchPointViewOffset,
457 kTapLabelWidth, kTouchPointViewHeight); 458 kTapLabelWidth, kTouchPointViewHeight);
458 touch_point_view_->SetVisible(false); 459 touch_point_view_->SetVisible(false);
459 touch_point_view_->SetPaintToLayer(true); 460 touch_point_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
460 touch_point_view_->layer()->SetFillsBoundsOpaquely(false); 461 touch_point_view_->layer()->SetFillsBoundsOpaquely(false);
461 touch_point_view_->layer()->GetAnimator()->AddObserver(this); 462 touch_point_view_->layer()->GetAnimator()->AddObserver(this);
462 touch_point_view_->set_background( 463 touch_point_view_->set_background(
463 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); 464 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT));
464 465
465 touch_point_view_->AddChildView(throbber_circle_); 466 touch_point_view_->AddChildView(throbber_circle_);
466 touch_point_view_->AddChildView(tap_label_); 467 touch_point_view_->AddChildView(tap_label_);
467 468
468 AddChildView(touch_point_view_); 469 AddChildView(touch_point_view_);
469 470
(...skipping 25 matching lines...) Expand all
495 base::string16 finish_msg_text = 496 base::string16 finish_msg_text =
496 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_FINISH_LABEL); 497 rb.GetLocalizedString(IDS_DISPLAY_TOUCH_CALIBRATION_FINISH_LABEL);
497 498
498 gfx::Rect msg_view_bounds( 499 gfx::Rect msg_view_bounds(
499 (display_.bounds().width() - kCompleteMessageViewWidth) / 2, 500 (display_.bounds().width() - kCompleteMessageViewWidth) / 2,
500 display_.bounds().height() / 3, kCompleteMessageViewWidth, 501 display_.bounds().height() / 3, kCompleteMessageViewWidth,
501 kCompleteMessageViewHeight); 502 kCompleteMessageViewHeight);
502 completion_message_view_ = 503 completion_message_view_ =
503 new CompletionMessageView(msg_view_bounds, finish_msg_text); 504 new CompletionMessageView(msg_view_bounds, finish_msg_text);
504 completion_message_view_->SetVisible(false); 505 completion_message_view_->SetVisible(false);
505 completion_message_view_->SetPaintToLayer(true); 506 completion_message_view_->SetPaintToLayer(ui::LAYER_TEXTURED);
506 completion_message_view_->layer()->SetFillsBoundsOpaquely(false); 507 completion_message_view_->layer()->SetFillsBoundsOpaquely(false);
507 completion_message_view_->layer()->GetAnimator()->AddObserver(this); 508 completion_message_view_->layer()->GetAnimator()->AddObserver(this);
508 completion_message_view_->set_background( 509 completion_message_view_->set_background(
509 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); 510 views::Background::CreateSolidBackground(SK_ColorTRANSPARENT));
510 511
511 AddChildView(completion_message_view_); 512 AddChildView(completion_message_view_);
512 } 513 }
513 514
514 void TouchCalibratorView::OnPaint(gfx::Canvas* canvas) { 515 void TouchCalibratorView::OnPaint(gfx::Canvas* canvas) {
515 OnPaintBackground(canvas); 516 OnPaintBackground(canvas);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 void TouchCalibratorView::SkipCurrentAnimation() { 718 void TouchCalibratorView::SkipCurrentAnimation() {
718 if (animator_->is_animating()) 719 if (animator_->is_animating())
719 animator_->End(); 720 animator_->End();
720 if (touch_point_view_ && 721 if (touch_point_view_ &&
721 touch_point_view_->layer()->GetAnimator()->is_animating()) { 722 touch_point_view_->layer()->GetAnimator()->is_animating()) {
722 touch_point_view_->layer()->GetAnimator()->StopAnimating(); 723 touch_point_view_->layer()->GetAnimator()->StopAnimating();
723 } 724 }
724 } 725 }
725 726
726 } // namespace chromeos 727 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698