diff options
author | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 00:51:19 +0000 |
---|---|---|
committer | jianli@chromium.org <jianli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-20 00:51:19 +0000 |
commit | acaf7c04e85fabf9f5aa6ed8e5a0d208a4a79b65 (patch) | |
tree | 4aa38ede9355b5df04872c68f34f7dcb1ed0f670 /chrome/browser/ui/panels/docked_panel_drag_handler.h | |
parent | 37549b31b330e15f335164ca40cca55c1239a864 (diff) | |
download | chromium_src-acaf7c04e85fabf9f5aa6ed8e5a0d208a4a79b65.zip chromium_src-acaf7c04e85fabf9f5aa6ed8e5a0d208a4a79b65.tar.gz chromium_src-acaf7c04e85fabf9f5aa6ed8e5a0d208a4a79b65.tar.bz2 |
Refactor panel dragging logic.
The intra-collection dragging logic that used to reside in DetachedPanelCollection and DockedPanelCollection has been moved to DockedPanelDragHandler and DetachedPanelDragHandler. The inter-collection dragging logic that used to reside in PanelDragController has been moved to DetachingDragHandler. Now PanelDragController is responsible for all the drags and it will figure out which drag handler to call in order to handle different kind of drags: dragging docked/detached panels, detaching, reattaching and future stacking and snapping.
TBR=thakis@chromium.org
BUG=none
TEST=existsing tests due to no new functionality
Review URL: https://chromiumcodereview.appspot.com/11475051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@174062 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/panels/docked_panel_drag_handler.h')
-rw-r--r-- | chrome/browser/ui/panels/docked_panel_drag_handler.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/ui/panels/docked_panel_drag_handler.h b/chrome/browser/ui/panels/docked_panel_drag_handler.h new file mode 100644 index 0000000..a90ad9fe --- /dev/null +++ b/chrome/browser/ui/panels/docked_panel_drag_handler.h @@ -0,0 +1,27 @@ +// 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_DOCKED_PANEL_DRAG_HANDLER_H_ +#define CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_DRAG_HANDLER_H_ + +#include "base/basictypes.h" + +class Panel; +namespace gfx { +class Point; +} + +// Handles all the drags to docked panels. +class DockedPanelDragHandler { + public: + static void HandleDrag(Panel* panel, const gfx::Point& target_position); + + private: + static void DragLeft(Panel* panel); + static void DragRight(Panel* panel); + + DISALLOW_IMPLICIT_CONSTRUCTORS(DockedPanelDragHandler); +}; + +#endif // CHROME_BROWSER_UI_PANELS_DOCKED_PANEL_DRAG_HANDLER_H_ |