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

Side by Side Diff: ash/rotator/screen_rotation_animator.h

Issue 1100763002: Inject CanAddURLToHistory into TopSitesImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@prefs
Patch Set: Fix error introduced during rebase Created 5 years, 7 months 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
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ 5 #ifndef ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_
6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ 6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "ui/gfx/display.h" 10 #include "ui/gfx/display.h"
11 11
12 namespace ash { 12 namespace ash {
13 13
14 // Utility to perform a screen rotation with an animation. 14 // Utility to perform a screen rotation with an animation.
15 class ASH_EXPORT ScreenRotationAnimator { 15 class ASH_EXPORT ScreenRotationAnimator {
16 public: 16 public:
17 explicit ScreenRotationAnimator(int64 display_id); 17 explicit ScreenRotationAnimator(int64 display_id);
18 ~ScreenRotationAnimator(); 18 ~ScreenRotationAnimator();
19 19
20 // Rotates |display_| to the |new_rotation| orientation, for the given 20 // Returns true if the screen rotation animation can be completed
21 // |source|. The rotation will also become active. 21 // successfully. For example an animation is not possible if |display_id_|
22 // specifies a gfx::Display that is not currently active. See
23 // www.crbug.com/479503.
24 bool CanAnimate() const;
25
26 // Rotates the gfx::Display specified by |display_id_| to the |new_rotation|
27 // orientation, for the given |source|. The rotation will also become active.
28 // Clients should only call |Rotate(gfx::Display::Rotation)| if |CanAnimate()|
29 // returns true.
22 void Rotate(gfx::Display::Rotation new_rotation, 30 void Rotate(gfx::Display::Rotation new_rotation,
23 gfx::Display::RotationSource source); 31 gfx::Display::RotationSource source);
24 32
25 private: 33 private:
26 // The id of the display to rotate. 34 // The id of the display to rotate.
27 int64 display_id_; 35 int64 display_id_;
28 36
29 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator); 37 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator);
30 }; 38 };
31 39
32 } // namespace ash 40 } // namespace ash
33 41
34 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ 42 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_
OLDNEW
« no previous file with comments | « ash/metrics/user_metrics_recorder.cc ('k') | ash/rotator/screen_rotation_animator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698