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/desktop.h" | 5 #include "ui/aura/desktop.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 float rotation = 0.0f; | 298 float rotation = 0.0f; |
299 int degrees = 0; | 299 int degrees = 0; |
300 const ui::Transform& transform = layer()->GetTargetTransform(); | 300 const ui::Transform& transform = layer()->GetTargetTransform(); |
301 if (ui::InterpolatedTransform::FactorTRS(transform, | 301 if (ui::InterpolatedTransform::FactorTRS(transform, |
302 NULL, &rotation, NULL)) | 302 NULL, &rotation, NULL)) |
303 degrees = NormalizeAngle(new_degrees - SymmetricRound(rotation)); | 303 degrees = NormalizeAngle(new_degrees - SymmetricRound(rotation)); |
304 | 304 |
305 if (degrees != 0) { | 305 if (degrees != 0) { |
306 layer()->GetAnimator()->set_preemption_strategy( | 306 layer()->GetAnimator()->set_preemption_strategy( |
307 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 307 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
308 layer()->GetAnimator()->ScheduleAnimationElement( | 308 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( |
309 new ScreenRotation(degrees)); | 309 new ui::LayerAnimationSequence(new ScreenRotation(degrees))); |
| 310 screen_rotation->AddObserver(this); |
| 311 layer()->GetAnimator()->ScheduleAnimation(screen_rotation.release()); |
310 return true; | 312 return true; |
311 } | 313 } |
312 } | 314 } |
313 } | 315 } |
314 #endif | 316 #endif |
315 | 317 |
316 if (focused_window_) { | 318 if (focused_window_) { |
317 KeyEvent translated_event(*event); | 319 KeyEvent translated_event(*event); |
318 return ProcessKeyEvent(focused_window_, &translated_event); | 320 return ProcessKeyEvent(focused_window_, &translated_event); |
319 } | 321 } |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 | 557 |
556 Desktop* Desktop::GetDesktop() { | 558 Desktop* Desktop::GetDesktop() { |
557 return this; | 559 return this; |
558 } | 560 } |
559 | 561 |
560 void Desktop::OnLayerAnimationEnded( | 562 void Desktop::OnLayerAnimationEnded( |
561 const ui::LayerAnimationSequence* animation) { | 563 const ui::LayerAnimationSequence* animation) { |
562 OnHostResized(host_->GetSize()); | 564 OnHostResized(host_->GetSize()); |
563 } | 565 } |
564 | 566 |
| 567 void Desktop::OnLayerAnimationScheduled( |
| 568 const ui::LayerAnimationSequence* animation) { |
| 569 } |
| 570 |
| 571 void Desktop::OnLayerAnimationAborted( |
| 572 const ui::LayerAnimationSequence* animation) { |
| 573 } |
| 574 |
565 void Desktop::SetFocusedWindow(Window* focused_window) { | 575 void Desktop::SetFocusedWindow(Window* focused_window) { |
566 if (focused_window == focused_window_ || | 576 if (focused_window == focused_window_ || |
567 (focused_window && !focused_window->CanFocus())) { | 577 (focused_window && !focused_window->CanFocus())) { |
568 return; | 578 return; |
569 } | 579 } |
570 if (focused_window_ && focused_window_->delegate()) | 580 if (focused_window_ && focused_window_->delegate()) |
571 focused_window_->delegate()->OnBlur(); | 581 focused_window_->delegate()->OnBlur(); |
572 focused_window_ = focused_window; | 582 focused_window_ = focused_window; |
573 if (focused_window_ && focused_window_->delegate()) | 583 if (focused_window_ && focused_window_->delegate()) |
574 focused_window_->delegate()->OnFocus(); | 584 focused_window_->delegate()->OnFocus(); |
(...skipping 28 matching lines...) Expand all Loading... |
603 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { | 613 base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) { |
604 bounds.set_size(gfx::Size(parsed_width, parsed_height)); | 614 bounds.set_size(gfx::Size(parsed_width, parsed_height)); |
605 } else if (use_fullscreen_host_window_) { | 615 } else if (use_fullscreen_host_window_) { |
606 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); | 616 bounds = gfx::Rect(DesktopHost::GetNativeDisplaySize()); |
607 } | 617 } |
608 | 618 |
609 return bounds; | 619 return bounds; |
610 } | 620 } |
611 | 621 |
612 } // namespace aura | 622 } // namespace aura |
OLD | NEW |