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

Unified Diff: chrome/browser/ui/panels/panel_drag_controller.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/panel_drag_controller.h
diff --git a/chrome/browser/ui/panels/panel_drag_controller.h b/chrome/browser/ui/panels/panel_drag_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..b2ffda994e035beaadf2d92222a06d333d5921cb
--- /dev/null
+++ b/chrome/browser/ui/panels/panel_drag_controller.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
+#define CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
+#pragma once
+
+#include "base/basictypes.h"
+#include "ui/gfx/point.h"
+
+class Panel;
+
+// Responsible for handling drags initiated for all panel strips, including
+// both intra-strip and inter-strip drags.
+class PanelDragController {
+ public:
+ PanelDragController();
+ ~PanelDragController();
+
+ void StartDragging(Panel* panel);
+ void Drag(int delta_x, int delta_y);
+ void EndDragging(bool cancelled);
+
+ Panel* dragging_panel() const { return dragging_panel_; }
+
+ private:
+ // Panel currently being dragged.
+ Panel* dragging_panel_;
+
+ DISALLOW_COPY_AND_ASSIGN(PanelDragController);
+};
+
+#endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698