| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // A helper class for animating the display of native widget content. | 5 // A helper class for animating the display of native widget content. |
| 6 // Currently only handle vertical sliding, but could be extended to handle | 6 // Currently only handle vertical sliding, but could be extended to handle |
| 7 // horizontal slides or other types of animations. | 7 // horizontal slides or other types of animations. |
| 8 // | 8 // |
| 9 // NOTE: This does not handle clipping. If you are not careful, you will | 9 // NOTE: This does not handle clipping. If you are not careful, you will |
| 10 // wind up with visibly overlapping widgets. If you need clipping, you can | 10 // wind up with visibly overlapping widgets. If you need clipping, you can |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/common/owned_widget_gtk.h" | 21 #include "chrome/common/owned_widget_gtk.h" |
| 22 | 22 |
| 23 class SlideAnimation; | 23 class SlideAnimation; |
| 24 | 24 |
| 25 class SlideAnimatorGtk : public AnimationDelegate { | 25 class SlideAnimatorGtk : public AnimationDelegate { |
| 26 public: | 26 public: |
| 27 class Delegate { | 27 class Delegate { |
| 28 public: | 28 public: |
| 29 // Called when a call to Close() finishes animating. | 29 // Called when a call to Close() finishes animating. |
| 30 virtual void Closed() = 0; | 30 virtual void Closed() = 0; |
| 31 | |
| 32 protected: | |
| 33 ~Delegate() {} | |
| 34 }; | 31 }; |
| 35 | 32 |
| 36 enum Direction { | 33 enum Direction { |
| 37 DOWN, | 34 DOWN, |
| 38 UP | 35 UP |
| 39 }; | 36 }; |
| 40 | 37 |
| 41 // |child| is the widget we pack into |widget_|. | 38 // |child| is the widget we pack into |widget_|. |
| 42 // |direction| indicates which side the contents will appear to come from. | 39 // |direction| indicates which side the contents will appear to come from. |
| 43 // |duration| is the duration of the slide in milliseconds, or 0 for default. | 40 // |duration| is the duration of the slide in milliseconds, or 0 for default. |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool fixed_needs_resize_; | 103 bool fixed_needs_resize_; |
| 107 | 104 |
| 108 // We need to move the child widget to (0, -height), but we don't know its | 105 // We need to move the child widget to (0, -height), but we don't know its |
| 109 // height until it has been allocated. This variable will be true until the | 106 // height until it has been allocated. This variable will be true until the |
| 110 // child widget has been allocated, at which point we will move it, and then | 107 // child widget has been allocated, at which point we will move it, and then |
| 111 // set this variable to false to indicate it should not be moved again. | 108 // set this variable to false to indicate it should not be moved again. |
| 112 bool child_needs_move_; | 109 bool child_needs_move_; |
| 113 }; | 110 }; |
| 114 | 111 |
| 115 #endif // CHROME_BROWSER_GTK_SLIDE_ANIMATOR_GTK_H_ | 112 #endif // CHROME_BROWSER_GTK_SLIDE_ANIMATOR_GTK_H_ |
| OLD | NEW |