Port Android relocation packer to chromium build
[chromium-blink-merge.git] / ash / display / shared_display_edge_indicator.h
blob5f8f6a0af7957e71aa40e0ced9220636510e6c98
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
3 // found in the LICENSE file.
5 #ifndef ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_
6 #define ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_
8 #include "ash/ash_export.h"
9 #include "base/basictypes.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "ui/gfx/animation/animation_delegate.h"
12 #include "ui/gfx/display.h"
14 namespace gfx {
15 class Rect;
16 class ThrobAnimation;
19 namespace views {
20 class View;
21 class Widget;
24 namespace ash {
26 // SharedDisplayEdgeIndicator is responsible for showing a window that indicates
27 // the edge that a window can be dragged into another display.
28 class ASH_EXPORT SharedDisplayEdgeIndicator : public gfx::AnimationDelegate {
29 public:
30 SharedDisplayEdgeIndicator();
31 ~SharedDisplayEdgeIndicator() override;
33 // Shows/Hides the indicator window. The |src_bounds| is for the window on
34 // the source display, and the |dst_bounds| is for the window on the other
35 // display.
36 void Show(const gfx::Rect& src_bounds, const gfx::Rect& dst_bounds);
37 void Hide();
39 // gfx::AnimationDelegate overrides:
40 void AnimationProgressed(const gfx::Animation* animation) override;
42 private:
43 // Used to show the displays' shared edge where a window can be moved across.
44 // |src_widget_| is for the display where drag starts and |dst_widget_| is
45 // for the other display.
46 views::View* src_indicator_;
47 views::View* dst_indicator_;
49 // Used to transition the opacity.
50 scoped_ptr<gfx::ThrobAnimation> animation_;
52 DISALLOW_COPY_AND_ASSIGN(SharedDisplayEdgeIndicator);
55 } // namespace ash
57 #endif // ASH_DISPLAY_SHARED_DISPLAY_EDGE_INDICATOR_H_