| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_ | 5 #ifndef ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_ |
| 6 #define ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_ | 6 #define ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_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 "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "ui/base/animation/animation_delegate.h" | 11 #include "ui/gfx/animation/animation_delegate.h" |
| 12 #include "ui/gfx/display.h" | 12 #include "ui/gfx/display.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Rect; | 15 class Rect; |
| 16 } | |
| 17 | |
| 18 namespace ui { | |
| 19 class ThrobAnimation; | 16 class ThrobAnimation; |
| 20 } | 17 } |
| 21 | 18 |
| 22 namespace views { | 19 namespace views { |
| 23 class View; | 20 class View; |
| 24 class Widget; | 21 class Widget; |
| 25 } | 22 } |
| 26 | 23 |
| 27 namespace ash { | 24 namespace ash { |
| 28 namespace internal { | 25 namespace internal { |
| 29 | 26 |
| 30 // SharedDisplayEdgeIndicator is responsible for showing a window that indicates | 27 // SharedDisplayEdgeIndicator is responsible for showing a window that indicates |
| 31 // the edge that a window can be dragged into another display. | 28 // the edge that a window can be dragged into another display. |
| 32 class ASH_EXPORT SharedDisplayEdgeIndicator : public ui::AnimationDelegate { | 29 class ASH_EXPORT SharedDisplayEdgeIndicator : public gfx::AnimationDelegate { |
| 33 public: | 30 public: |
| 34 SharedDisplayEdgeIndicator(); | 31 SharedDisplayEdgeIndicator(); |
| 35 virtual ~SharedDisplayEdgeIndicator(); | 32 virtual ~SharedDisplayEdgeIndicator(); |
| 36 | 33 |
| 37 // Shows/Hides the indicator window. The |src_bounds| is for the window on | 34 // Shows/Hides the indicator window. The |src_bounds| is for the window on |
| 38 // the source display, and the |dst_bounds| is for the window on the other | 35 // the source display, and the |dst_bounds| is for the window on the other |
| 39 // display. | 36 // display. |
| 40 void Show(const gfx::Rect& src_bounds, const gfx::Rect& dst_bounds); | 37 void Show(const gfx::Rect& src_bounds, const gfx::Rect& dst_bounds); |
| 41 void Hide(); | 38 void Hide(); |
| 42 | 39 |
| 43 // ui::AnimationDelegate overrides: | 40 // gfx::AnimationDelegate overrides: |
| 44 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 41 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| 45 | 42 |
| 46 private: | 43 private: |
| 47 // Used to show the displays' shared edge where a window can be moved across. | 44 // Used to show the displays' shared edge where a window can be moved across. |
| 48 // |src_widget_| is for the display where drag starts and |dst_widget_| is | 45 // |src_widget_| is for the display where drag starts and |dst_widget_| is |
| 49 // for the other display. | 46 // for the other display. |
| 50 views::View* src_indicator_; | 47 views::View* src_indicator_; |
| 51 views::View* dst_indicator_; | 48 views::View* dst_indicator_; |
| 52 | 49 |
| 53 // Used to transition the opacity. | 50 // Used to transition the opacity. |
| 54 scoped_ptr<ui::ThrobAnimation> animation_; | 51 scoped_ptr<gfx::ThrobAnimation> animation_; |
| 55 | 52 |
| 56 DISALLOW_COPY_AND_ASSIGN(SharedDisplayEdgeIndicator); | 53 DISALLOW_COPY_AND_ASSIGN(SharedDisplayEdgeIndicator); |
| 57 }; | 54 }; |
| 58 | 55 |
| 59 } // namespace internal | 56 } // namespace internal |
| 60 } // namespace ash | 57 } // namespace ash |
| 61 | 58 |
| 62 #endif // ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_ | 59 #endif // ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_ |
| OLD | NEW |