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

Side by Side Diff: ui/aura_shell/shell_accelerator_controller.cc

Issue 8741016: Should use startAnimation to take in account preemption strategy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_shell/shell_accelerator_controller.h" 5 #include "ui/aura_shell/shell_accelerator_controller.h"
6 6
7 #include "ui/aura/desktop.h" 7 #include "ui/aura/desktop.h"
8 #include "ui/aura/event.h" 8 #include "ui/aura/event.h"
9 #include "ui/aura_shell/shell.h" 9 #include "ui/aura_shell/shell.h"
10 #include "ui/base/accelerators/accelerator.h" 10 #include "ui/base/accelerators/accelerator.h"
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 case 11: delta = 90; break; 57 case 11: delta = 90; break;
58 case 12: delta = 180; break; 58 case 12: delta = 180; break;
59 case 13: delta = 180; break; 59 case 13: delta = 180; break;
60 } 60 }
61 i = (i + 1) % 14; 61 i = (i + 1) % 14;
62 aura::Desktop::GetInstance()->layer()->GetAnimator()->set_preemption_strategy( 62 aura::Desktop::GetInstance()->layer()->GetAnimator()->set_preemption_strategy(
63 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); 63 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
64 scoped_ptr<ui::LayerAnimationSequence> screen_rotation( 64 scoped_ptr<ui::LayerAnimationSequence> screen_rotation(
65 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta))); 65 new ui::LayerAnimationSequence(new ui::ScreenRotation(delta)));
66 screen_rotation->AddObserver(aura::Desktop::GetInstance()); 66 screen_rotation->AddObserver(aura::Desktop::GetInstance());
67 aura::Desktop::GetInstance()->layer()->GetAnimator()->ScheduleAnimation( 67 aura::Desktop::GetInstance()->layer()->GetAnimator()->StartAnimation(
68 screen_rotation.release()); 68 screen_rotation.release());
69 } 69 }
70 #endif 70 #endif
71 71
72 } // namespace 72 } // namespace
73 73
74 namespace aura_shell { 74 namespace aura_shell {
75 75
76 //////////////////////////////////////////////////////////////////////////////// 76 ////////////////////////////////////////////////////////////////////////////////
77 // ShellAcceleratorController, public: 77 // ShellAcceleratorController, public:
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } else if (accelerator.key_code() == ui::VKEY_HOME && 117 } else if (accelerator.key_code() == ui::VKEY_HOME &&
118 accelerator.IsCtrlDown()) { 118 accelerator.IsCtrlDown()) {
119 RotateScreen(); 119 RotateScreen();
120 return true; 120 return true;
121 } 121 }
122 #endif 122 #endif
123 return false; 123 return false;
124 } 124 }
125 125
126 } // namespace aura_shell 126 } // namespace aura_shell
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698