| Index: chrome/browser/ui/panels/panel_drag_controller.h
|
| diff --git a/chrome/browser/ui/panels/panel_drag_controller.h b/chrome/browser/ui/panels/panel_drag_controller.h
|
| index a58b7644077813d31c2cd5fda3a5ed3d4ede0079..8302fa54a4facf57afe6514287465e2d33bb77c7 100644
|
| --- a/chrome/browser/ui/panels/panel_drag_controller.h
|
| +++ b/chrome/browser/ui/panels/panel_drag_controller.h
|
| @@ -11,16 +11,20 @@
|
| #include "ui/gfx/point.h"
|
|
|
| class Panel;
|
| +class PanelManager;
|
| +class PanelStrip;
|
|
|
| // Responsible for handling drags initiated for all panels, including both
|
| // intra-strip and inter-strip drags.
|
| class PanelDragController {
|
| public:
|
| - PanelDragController();
|
| + explicit PanelDragController(PanelManager* panel_manager);
|
| ~PanelDragController();
|
|
|
| - void StartDragging(Panel* panel);
|
| - void Drag(int delta_x, int delta_y);
|
| + // Drags the given panel.
|
| + // |mouse_location| is in screen coordinate system.
|
| + void StartDragging(Panel* panel, const gfx::Point& mouse_location);
|
| + void Drag(const gfx::Point& mouse_location);
|
| void EndDragging(bool cancelled);
|
|
|
| // Asynchronous confirmation of panel having been closed.
|
| @@ -32,16 +36,48 @@ class PanelDragController {
|
| gfx::Point dragging_panel_original_position() const {
|
| return dragging_panel_original_position_;
|
| }
|
| + bool has_dragged_to_other_strip() const {
|
| + return has_dragged_to_other_strip_;
|
| + }
|
|
|
| private:
|
| + // Returns the panel strip to drag to.
|
| + PanelStrip* CanDragToDockedStrip(const gfx::Point& mouse_location) const;
|
| + PanelStrip* CanDragToDetachedStrip(const gfx::Point& mouse_location) const;
|
| +
|
| + // Helper method to transit the dragging panel to the new strip at the new
|
| + // position.
|
| + static void MoveToStrip(Panel* panel,
|
| + PanelStrip* new_strip,
|
| + const gfx::Point& new_position);
|
| +
|
| + PanelManager* panel_manager_; // Weak, owns us.
|
| +
|
| // Panel currently being dragged.
|
| Panel* dragging_panel_;
|
|
|
| - // Original position, in screen coordinate system, of the panel being dragged.
|
| + // The original panel strip that the drag is initiated.
|
| + PanelStrip* dragging_panel_original_strip_;
|
| +
|
| + // Original position, in screen coordinates, of the panel being dragged.
|
| // This is used to get back to the original position when we cancel the
|
| // dragging.
|
| gfx::Point dragging_panel_original_position_;
|
|
|
| + // The mouse location, in screen coordinates, when mouse press/drag event is
|
| + // received last time.
|
| + gfx::Point last_mouse_location_;
|
| +
|
| + // When the panel is dragged within the docked strip, y delta of the drag is
|
| + // not applied to new panel position. We need to keep track of the total
|
| + // omitted delta values so that the panel can jump immediately to the position
|
| + // where the panel detach is triggered.
|
| + int total_ommitted_delta_y_;
|
| +
|
| + // The flag that indicates if the dragging panel has ever been dragged into
|
| + // other strip.
|
| + bool has_dragged_to_other_strip_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(PanelDragController);
|
| };
|
|
|
|
|