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

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

Issue 9353002: Created new PanelStrip base class and make DockedPanelStrip and OverflowPanelStrip its subclasses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: added the new files - d'oh! 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_STRIP_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
7 #pragma once
8
9 #include "ui/gfx/rect.h"
10
11 class Panel;
12
13 // Common base class for a collection of panels. Subclasses manage
14 // various layouts for displaying panels in the collection.
15 class PanelStrip {
16 public:
17 // Types of layout for the panel collections.
18 enum Type {
19 DETACHED, // free-floating panels
20 DOCKED, // panels are 'docked' along the window's edge
21 IN_OVERFLOW, // panels that cannot fit in the 'docked' panels area
22 };
23
24 Type type() const { return type_; }
25
26 // Sets the bounds of the panel strip.
27 // |display_area| is in screen coordinates.
28 virtual void SetDisplayArea(const gfx::Rect& display_area) = 0;
29
30 // Updates the positioning of all panels in the collection, usually as
31 // a result of removing or resizing a panel in collection.
32 virtual void RefreshLayout() = 0;
33
34 // Adds |panel| to the collection of panels.
35 virtual void AddPanel(Panel* panel) = 0;
36
37 // Removes |panel| from the collection of panels. Invoked asynchronously
38 // after a panel has been closed.
39 // Returns |false| if the panel is not in the strip.
40 virtual bool RemovePanel(Panel* panel) = 0;
41
42 // Closes all panels in the collection. Panels will be removed after closing.
43 virtual void CloseAll() = 0;
44
45 // Resizes the |panel| to the |preferred_window_size|.
46 // The preferred size may be adjusted to fit layout constraints.
47 virtual void ResizePanelWindow(Panel* panel,
48 const gfx::Size& preferred_window_size) = 0;
Dmitry Titov 2012/02/07 00:46:46 Could you add a comment to reflect which coord sys
jennb 2012/02/07 01:06:09 Done.
49
50 // Starts dragging the |panel|.
51 virtual void StartDragging(Panel* panel) = 0;
Dmitry Titov 2012/02/07 00:46:46 Is this a temporary thing? We discussed this to be
jennb 2012/02/07 01:06:09 Removed from base class.
52
53 // Updates the drag position of the panel currently being dragged.
54 // |delta_x| and |delta_y| is the change from the initial mouse position
55 // at the start of the drag.
56 virtual void Drag(int delta_x, int delta_y) = 0;
57
58 // Completes the current drag.
59 // |cancelled| is true if the drag was cancelled.
60 virtual void EndDragging(bool cancelled) = 0;
61
62 // Invoked when the draw attention state of the panel has changed.
63 // Subclass should update the display of the panel to match the new
64 // draw attention state.
65 virtual void OnPanelAttentionStateChanged(Panel* panel) = 0;
66
67 protected:
68 explicit PanelStrip(Type type);
69 ~PanelStrip();
Dmitry Titov 2012/02/07 00:46:46 ~ should be virtual
jennb 2012/02/07 01:06:09 Done.
70
71 Type type_; // Type of this panel strip.
Dmitry Titov 2012/02/07 00:46:46 should it be 'const'?
jennb 2012/02/07 01:06:09 Done.
72 };
73
74 #endif // CHROME_BROWSER_UI_PANELS_PANEL_STRIP_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_overflow_browsertest.cc ('k') | chrome/browser/ui/panels/panel_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698