OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/aura/window.h" | 5 #include "ui/aura/window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "ui/aura/desktop.h" | 10 #include "ui/aura/desktop.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 return IsVisible() && show_state_ == ui::SHOW_STATE_FULLSCREEN; | 402 return IsVisible() && show_state_ == ui::SHOW_STATE_FULLSCREEN; |
403 | 403 |
404 for (Windows::const_iterator it = children_.begin(); | 404 for (Windows::const_iterator it = children_.begin(); |
405 it != children_.end(); ++it) { | 405 it != children_.end(); ++it) { |
406 if ((*it)->IsOrContainsFullscreenWindow()) | 406 if ((*it)->IsOrContainsFullscreenWindow()) |
407 return true; | 407 return true; |
408 } | 408 } |
409 return false; | 409 return false; |
410 } | 410 } |
411 | 411 |
412 // static | 412 Window::ScopedAnimationSettings::ScopedAnimationSettings( |
413 ui::Animation* Window::CreateDefaultAnimation() { | 413 ui::LayerAnimator* animator) |
414 std::vector<ui::MultiAnimation::Part> parts; | 414 : ui::LayerAnimator::ScopedSettings(animator) { |
415 parts.push_back(ui::MultiAnimation::Part(200, ui::Tween::LINEAR)); | 415 SetTransitionDuration(base::TimeDelta::FromMilliseconds(200)); |
416 ui::MultiAnimation* multi_animation = new ui::MultiAnimation(parts); | 416 } |
417 multi_animation->set_continuous(false); | 417 |
418 return multi_animation; | 418 Window::ScopedAnimationSettings::~ScopedAnimationSettings() { |
419 } | 419 } |
420 | 420 |
421 Desktop* Window::GetDesktop() { | 421 Desktop* Window::GetDesktop() { |
422 return parent_ ? parent_->GetDesktop() : NULL; | 422 return parent_ ? parent_->GetDesktop() : NULL; |
423 } | 423 } |
424 | 424 |
425 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { | 425 void Window::SetBoundsInternal(const gfx::Rect& new_bounds) { |
426 const gfx::Rect old_bounds = bounds(); | 426 const gfx::Rect old_bounds = bounds(); |
427 bool was_move = old_bounds.size() == new_bounds.size(); | 427 bool was_move = old_bounds.size() == new_bounds.size(); |
428 layer_->SetBounds(new_bounds); | 428 layer_->SetBounds(new_bounds); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 break; | 506 break; |
507 } | 507 } |
508 | 508 |
509 return delegate_ ? this : NULL; | 509 return delegate_ ? this : NULL; |
510 } | 510 } |
511 | 511 |
512 void Window::OnPaintLayer(gfx::Canvas* canvas) { | 512 void Window::OnPaintLayer(gfx::Canvas* canvas) { |
513 delegate_->OnPaint(canvas); | 513 delegate_->OnPaint(canvas); |
514 } | 514 } |
515 | 515 |
516 void Window::OnLayerAnimationEnded(const ui::Animation* animation) { | 516 void Window::OnLayerAnimationEnded( |
| 517 const ui::LayerAnimationSequence* animation) { |
517 } | 518 } |
518 | 519 |
519 } // namespace aura | 520 } // namespace aura |
OLD | NEW |