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

Side by Side Diff: chrome/browser/ui/panels/panel_strip.h

Issue 9546001: Support detaching/attaching panels via inter-strip drags. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac trybot Created 8 years, 9 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ 6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
7 #pragma once 7 #pragma once
8 8
9 #include "ui/gfx/point.h"
9 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
10 11
11 class Panel; 12 class Panel;
12 13
13 // Common base class for a collection of panels. Subclasses manage 14 // Common base class for a collection of panels. Subclasses manage
14 // various layouts for displaying panels in the collection. 15 // various layouts for displaying panels in the collection.
15 class PanelStrip { 16 class PanelStrip {
16 public: 17 public:
17 // Types of layout for the panel collections. 18 // Types of layout for the panel collections.
18 enum Type { 19 enum Type {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 60
60 // Updates the display to show |panel| as minimized/restored. 61 // Updates the display to show |panel| as minimized/restored.
61 virtual void MinimizePanel(Panel* panel) = 0; 62 virtual void MinimizePanel(Panel* panel) = 0;
62 virtual void RestorePanel(Panel* panel) = 0; 63 virtual void RestorePanel(Panel* panel) = 0;
63 64
64 virtual bool IsPanelMinimized(const Panel* panel) const = 0; 65 virtual bool IsPanelMinimized(const Panel* panel) const = 0;
65 66
66 // Returns true if |panel| can be shown as active. 67 // Returns true if |panel| can be shown as active.
67 virtual bool CanShowPanelAsActive(const Panel* panel) const = 0; 68 virtual bool CanShowPanelAsActive(const Panel* panel) const = 0;
68 69
70 // Saves/restores/discards the placement information of |panel|. This is
71 // useful in bringing back the dragging panel to its original positioning
72 // when the drag is cancelled. After the placement information is saved,
73 // the caller should only call one of RestorePanelToSavedPlacement and
74 // DiscardSavedPanelPlacement.
75 virtual void SavePanelPlacement(Panel* panel) = 0;
76 virtual void RestorePanelToSavedPlacement() = 0;
77 virtual void DiscardSavedPanelPlacement() = 0;
78
69 // Returns true if |panel| is draggable. 79 // Returns true if |panel| is draggable.
70 virtual bool CanDragPanel(const Panel* panel) const = 0; 80 virtual bool CanDragPanel(const Panel* panel) const = 0;
71 81
72 // Drags |panel| in the bounds of this strip. 82 // Starts dragging |panel| within this strip. The panel should already be
73 virtual void StartDraggingPanel(Panel* panel) = 0; 83 // in this strip.
74 // |delta_x| and |delta_y| denotes how much the mouse has been moved since 84 virtual void StartDraggingPanelWithinStrip(Panel* panel) = 0;
75 // last time when DragPanel or StartDraggingPanel is called. 85
76 virtual void DragPanel(Panel* panel, int delta_x, int delta_y) = 0; 86 // Drags |panel| within this strip.
77 virtual void EndDraggingPanel(Panel* panel, bool cancelled) = 0; 87 // |delta_x| and |delta_y| represents the offset from the last mouse location
88 // when StartDraggingPanelWithinStrip or DragPanelWithinStrip is called.
89 virtual void DragPanelWithinStrip(Panel* panel, int delta_x, int delta_y) = 0;
90
91 // Ends dragging |panel| within this strip. |aborted| means the drag within
92 // this strip is aborted due to one of the following:
93 // 1) the drag leaves this strip and enters other strip
94 // 2) the drag gets cancelled
95 // If |aborted| is true, |panel| will stay as it is; otherwise, it will be
96 // moved to its finalized position.
97 // The drag controller is responsible for restoring the panel back to its
98 // original strip and position when the drag gets cancelled.
99 virtual void EndDraggingPanelWithinStrip(Panel* panel, bool aborted) = 0;
78 100
79 protected: 101 protected:
80 explicit PanelStrip(Type type); 102 explicit PanelStrip(Type type);
81 virtual ~PanelStrip(); 103 virtual ~PanelStrip();
82 104
83 const Type type_; // Type of this panel strip. 105 const Type type_; // Type of this panel strip.
84 }; 106 };
85 107
86 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_ 108 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698