| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/corewm/window_animations.h" | 5 #include "ui/views/corewm/window_animations.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 kWindowVisibilityAnimationTransitionKey); | 521 kWindowVisibilityAnimationTransitionKey); |
| 522 return (prop & transition) != 0; | 522 return (prop & transition) != 0; |
| 523 } | 523 } |
| 524 | 524 |
| 525 void SetWindowVisibilityAnimationDuration(aura::Window* window, | 525 void SetWindowVisibilityAnimationDuration(aura::Window* window, |
| 526 const TimeDelta& duration) { | 526 const TimeDelta& duration) { |
| 527 window->SetProperty(kWindowVisibilityAnimationDurationKey, | 527 window->SetProperty(kWindowVisibilityAnimationDurationKey, |
| 528 static_cast<int>(duration.ToInternalValue())); | 528 static_cast<int>(duration.ToInternalValue())); |
| 529 } | 529 } |
| 530 | 530 |
| 531 base::TimeDelta GetWindowVisibilityAnimationDuration(aura::Window* window) { |
| 532 return base::TimeDelta::FromInternalValue( |
| 533 window->GetProperty(kWindowVisibilityAnimationDurationKey)); |
| 534 } |
| 535 |
| 531 void SetWindowVisibilityAnimationVerticalPosition(aura::Window* window, | 536 void SetWindowVisibilityAnimationVerticalPosition(aura::Window* window, |
| 532 float position) { | 537 float position) { |
| 533 window->SetProperty(kWindowVisibilityAnimationVerticalPositionKey, position); | 538 window->SetProperty(kWindowVisibilityAnimationVerticalPositionKey, position); |
| 534 } | 539 } |
| 535 | 540 |
| 536 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( | 541 ui::ImplicitAnimationObserver* CreateHidingWindowAnimationObserver( |
| 537 aura::Window* window) { | 542 aura::Window* window) { |
| 538 return new HidingWindowAnimationObserver(window); | 543 return new HidingWindowAnimationObserver(window); |
| 539 } | 544 } |
| 540 | 545 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 561 | 566 |
| 562 bool WindowAnimationsDisabled(aura::Window* window) { | 567 bool WindowAnimationsDisabled(aura::Window* window) { |
| 563 return (window && | 568 return (window && |
| 564 window->GetProperty(aura::client::kAnimationsDisabledKey)) || | 569 window->GetProperty(aura::client::kAnimationsDisabledKey)) || |
| 565 CommandLine::ForCurrentProcess()->HasSwitch( | 570 CommandLine::ForCurrentProcess()->HasSwitch( |
| 566 switches::kWindowAnimationsDisabled); | 571 switches::kWindowAnimationsDisabled); |
| 567 } | 572 } |
| 568 | 573 |
| 569 } // namespace corewm | 574 } // namespace corewm |
| 570 } // namespace views | 575 } // namespace views |
| OLD | NEW |