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

Side by Side Diff: ash/wm/overview/window_grid.cc

Issue 2016203002: Widget opacity goes from 0 to 1, not 0 to 255. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 6 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/system/user/user_view.cc ('k') | cc/layers/layer.cc » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/overview/window_grid.h" 5 #include "ash/wm/overview/window_grid.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 views::View* content_view = new views::View; 428 views::View* content_view = new views::View;
429 content_view->set_background( 429 content_view->set_background(
430 views::Background::CreateSolidBackground(kWindowSelectionColor)); 430 views::Background::CreateSolidBackground(kWindowSelectionColor));
431 content_view->SetBorder(views::Border::CreateSolidBorder( 431 content_view->SetBorder(views::Border::CreateSolidBorder(
432 kWindowSelectionBorderThickness, kWindowSelectionBorderColor)); 432 kWindowSelectionBorderThickness, kWindowSelectionBorderColor));
433 selection_widget_->SetContentsView(content_view); 433 selection_widget_->SetContentsView(content_view);
434 selection_widget_window->GetParent()->StackChildAtBottom( 434 selection_widget_window->GetParent()->StackChildAtBottom(
435 selection_widget_window); 435 selection_widget_window);
436 selection_widget_->Show(); 436 selection_widget_->Show();
437 // New selection widget starts with 0 opacity and then fades in. 437 // New selection widget starts with 0 opacity and then fades in.
438 selection_widget_window->SetOpacity(0); 438 selection_widget_window->SetOpacity(0.f);
439 439
440 const gfx::Rect target_bounds = SelectedWindow()->target_bounds(); 440 const gfx::Rect target_bounds = SelectedWindow()->target_bounds();
441 gfx::Vector2d fade_out_direction = 441 gfx::Vector2d fade_out_direction =
442 GetSlideVectorForFadeIn(direction, target_bounds); 442 GetSlideVectorForFadeIn(direction, target_bounds);
443 display::Display dst_display = 443 display::Display dst_display =
444 display::Screen::GetScreen()->GetDisplayMatching(target_bounds); 444 display::Screen::GetScreen()->GetDisplayMatching(target_bounds);
445 selection_widget_window->SetBoundsInScreen(target_bounds - fade_out_direction, 445 selection_widget_window->SetBoundsInScreen(target_bounds - fade_out_direction,
446 dst_display); 446 dst_display);
447 } 447 }
448 448
(...skipping 16 matching lines...) Expand all
465 animation_settings.SetTransitionDuration( 465 animation_settings.SetTransitionDuration(
466 base::TimeDelta::FromMilliseconds( 466 base::TimeDelta::FromMilliseconds(
467 kOverviewSelectorTransitionMilliseconds)); 467 kOverviewSelectorTransitionMilliseconds));
468 animation_settings.SetPreemptionStrategy( 468 animation_settings.SetPreemptionStrategy(
469 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 469 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
470 animation_settings.SetTweenType(gfx::Tween::FAST_OUT_LINEAR_IN); 470 animation_settings.SetTweenType(gfx::Tween::FAST_OUT_LINEAR_IN);
471 // CleanupWidgetAfterAnimationObserver will delete itself (and the 471 // CleanupWidgetAfterAnimationObserver will delete itself (and the
472 // widget) when the movement animation is complete. 472 // widget) when the movement animation is complete.
473 animation_settings.AddObserver( 473 animation_settings.AddObserver(
474 new CleanupWidgetAfterAnimationObserver(std::move(selection_widget_))); 474 new CleanupWidgetAfterAnimationObserver(std::move(selection_widget_)));
475 old_selection->SetOpacity(0); 475 old_selection->SetOpacity(0.f);
476 old_selection_window->SetBounds(old_selection_window->GetBounds() + 476 old_selection_window->SetBounds(old_selection_window->GetBounds() +
477 fade_out_direction); 477 fade_out_direction);
478 old_selection->Hide(); 478 old_selection->Hide();
479 } 479 }
480 if (out_of_bounds) 480 if (out_of_bounds)
481 return; 481 return;
482 482
483 if (!selection_widget_) 483 if (!selection_widget_)
484 InitSelectionWidget(direction); 484 InitSelectionWidget(direction);
485 // Send an a11y alert so that if ChromeVox is enabled, the item label is 485 // Send an a11y alert so that if ChromeVox is enabled, the item label is
(...skipping 17 matching lines...) Expand all
503 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); 503 ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
504 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); 504 selection_widget_->SetBounds(SelectedWindow()->target_bounds());
505 selection_widget_->SetOpacity(1.f); 505 selection_widget_->SetOpacity(1.f);
506 return; 506 return;
507 } 507 }
508 selection_widget_->SetBounds(SelectedWindow()->target_bounds()); 508 selection_widget_->SetBounds(SelectedWindow()->target_bounds());
509 selection_widget_->SetOpacity(1.f); 509 selection_widget_->SetOpacity(1.f);
510 } 510 }
511 511
512 } // namespace ash 512 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/user/user_view.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698