Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(555)

Unified Diff: chrome/browser/ui/panels/detached_panel_strip.h

Issue 9403035: Refactor intra-strip panel drags by introducing PanelDragController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybot Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/detached_panel_strip.h
diff --git a/chrome/browser/ui/panels/detached_panel_strip.h b/chrome/browser/ui/panels/detached_panel_strip.h
index 868093bd59a237e6e9b9179bcf6b384d90b86932..32569cc8bfa4ac4a2d5705af2fac5c6eb1765e47 100644
--- a/chrome/browser/ui/panels/detached_panel_strip.h
+++ b/chrome/browser/ui/panels/detached_panel_strip.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "chrome/browser/ui/panels/panel.h"
#include "chrome/browser/ui/panels/panel_strip.h"
+#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
class Browser;
@@ -36,6 +37,10 @@ class DetachedPanelStrip : public PanelStrip {
virtual void ActivatePanel(Panel* panel) OVERRIDE;
virtual void MinimizePanel(Panel* panel) OVERRIDE;
virtual void RestorePanel(Panel* panel) OVERRIDE;
+ virtual bool CanDragPanel(Panel* panel) const OVERRIDE;
+ virtual void StartDraggingPanel(Panel* panel) OVERRIDE;
+ virtual void DragPanel(int delta_x, int delta_y) OVERRIDE;
+ virtual void EndDraggingPanel(bool cancelled) OVERRIDE;
int num_panels() const { return panels_.size(); }
const Panels& panels() const { return panels_; }
@@ -49,6 +54,13 @@ class DetachedPanelStrip : public PanelStrip {
// Collection of all panels.
Panels panels_;
+ // Panel being dragged.
+ Panel* dragging_panel_;
jennb 2012/02/16 22:31:00 This is already tracked in drag controller. Do we
jianli 2012/02/16 23:05:52 They're served for different purpose. PanelDragCon
+
+ // Original position 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_;
jennb 2012/02/16 22:31:00 What is position? the x,y coordinates of the panel
jianli 2012/02/16 23:05:52 The origin (x, y coordinates) of the panel's bound
+
DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip);
};

Powered by Google App Engine
This is Rietveld 408576698