OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <set> |
| 10 #include "base/basictypes.h" |
| 11 #include "ui/gfx/point.h" |
| 12 |
| 13 class Panel; |
| 14 |
| 15 // Responsible for handling drags initiated for all panels, including both |
| 16 // intra-strip and inter-strip drags. |
| 17 class PanelDragController { |
| 18 public: |
| 19 PanelDragController(); |
| 20 ~PanelDragController(); |
| 21 |
| 22 void StartDragging(Panel* panel); |
| 23 void Drag(int delta_x, int delta_y); |
| 24 void EndDragging(bool cancelled); |
| 25 |
| 26 Panel* dragging_panel() const { return dragging_panel_; } |
| 27 gfx::Point dragging_panel_original_position() const { |
| 28 return dragging_panel_original_position_; |
| 29 } |
| 30 |
| 31 private: |
| 32 // Panel currently being dragged. |
| 33 Panel* dragging_panel_; |
| 34 |
| 35 // Original position, in screen coordinate system, of the panel being dragged. |
| 36 // This is used to get back to the original position when we cancel the |
| 37 // dragging. |
| 38 gfx::Point dragging_panel_original_position_; |
| 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(PanelDragController); |
| 41 }; |
| 42 |
| 43 #endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_ |
OLD | NEW |