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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
7 #pragma once
8
9 #include <set>
10 #include "base/basictypes.h"
11 #include "ui/gfx/point.h"
12
13 class Panel;
14
15 // Responsible for handling drags initiated for all panels, including both
16 // intra-strip and inter-strip drags.
17 class PanelDragController {
18 public:
19 PanelDragController();
20 ~PanelDragController();
21
22 void StartDragging(Panel* panel);
23 void Drag(int delta_x, int delta_y);
24 void EndDragging(bool cancelled);
25
26 Panel* dragging_panel() const { return dragging_panel_; }
27 gfx::Point dragging_panel_original_position() const {
28 return dragging_panel_original_position_;
29 }
30
31 private:
32 // Panel currently being dragged.
33 Panel* dragging_panel_;
34
35 // Original position, in screen coordinate system, of the panel being dragged.
36 // This is used to get back to the original position when we cancel the
37 // dragging.
38 gfx::Point dragging_panel_original_position_;
39
40 DISALLOW_COPY_AND_ASSIGN(PanelDragController);
41 };
42
43 #endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698