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

Side by Side Diff: ui/aura/window.cc

Issue 8362006: Reland r107720 - Enable the new layer animation framework. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with master. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698