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

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 panel strips, including
jennb 2012/02/17 21:28:45 s/panel strips/panels ?
jianli 2012/02/17 23:52:56 Done.
16 // both 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 // Checks if |panel| can be removed now. If not, it will be scheduled to be
27 // removed later.
28 bool CanRemovePanel(Panel* panel);
29
30 Panel* dragging_panel() const { return dragging_panel_; }
31
32 private:
33 void DelayedRemove();
34
35 // Panel currently being dragged.
36 Panel* dragging_panel_;
37
38 // Stores the panels that are pending to remove. We want to delay the removal
39 // when we're in the process of the dragging.
40 std::set<Panel*> panels_pending_to_remove_;
41
42 DISALLOW_COPY_AND_ASSIGN(PanelDragController);
43 };
44
45 #endif // CHROME_BROWSER_UI_PANELS_PANEL_DRAG_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698