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

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 per feedback 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..c50d24b79340ca0af6b8c414d7cd7b448bdc920c 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,10 @@ class DetachedPanelStrip : public PanelStrip {
// Collection of all panels.
Panels panels_;
+ // 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/17 21:28:45 This feels like it belongs in drag controller. A
jianli 2012/02/17 23:52:56 Done.
+
DISALLOW_COPY_AND_ASSIGN(DetachedPanelStrip);
};

Powered by Google App Engine
This is Rietveld 408576698