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

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

Issue 7537030: Make panel adjust bounds per preferred size change notification on Windows. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_MANAGER_H_ 5 #ifndef CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_
6 #define CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ 6 #define CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 20 matching lines...) Expand all
31 Panel* CreatePanel(Browser* browser); 31 Panel* CreatePanel(Browser* browser);
32 32
33 void Remove(Panel* panel); 33 void Remove(Panel* panel);
34 void RemoveAll(); 34 void RemoveAll();
35 35
36 // Drags the given panel. 36 // Drags the given panel.
37 void StartDragging(Panel* panel); 37 void StartDragging(Panel* panel);
38 void Drag(int delta_x); 38 void Drag(int delta_x);
39 void EndDragging(bool cancelled); 39 void EndDragging(bool cancelled);
40 40
41 // Updates the bounds of the given panel as the preferred size gets changed.
42 void UpdatePreferredSize(Panel* panel, const gfx::Size& pref_size);
43
41 // Should we bring up the titlebar, given the current mouse point? 44 // Should we bring up the titlebar, given the current mouse point?
42 bool ShouldBringUpTitleBarForAllMinimizedPanels(int mouse_x, 45 bool ShouldBringUpTitleBarForAllMinimizedPanels(int mouse_x,
43 int mouse_y) const; 46 int mouse_y) const;
44 47
45 // Brings up or down the title-bar for all minimized panels. 48 // Brings up or down the title-bar for all minimized panels.
46 void BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up); 49 void BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up);
47 50
48 int num_panels() const { return panels_.size(); } 51 int num_panels() const { return panels_.size(); }
49 52
50 private: 53 private:
(...skipping 25 matching lines...) Expand all
76 bool ComputeBoundsForNextPanel(gfx::Rect* bounds, bool allow_size_change); 79 bool ComputeBoundsForNextPanel(gfx::Rect* bounds, bool allow_size_change);
77 80
78 // Finds one panel to close so that we may have space for the new panel 81 // Finds one panel to close so that we may have space for the new panel
79 // created by |extension|. 82 // created by |extension|.
80 void FindAndClosePanelOnOverflow(const Extension* extension); 83 void FindAndClosePanelOnOverflow(const Extension* extension);
81 84
82 // Help functions to drag the given panel. 85 // Help functions to drag the given panel.
83 void DragLeft(); 86 void DragLeft();
84 void DragRight(); 87 void DragRight();
85 88
89 // Updates the maximum size of each panel as the result of adding, removing,
90 // or sizing panels.
91 void UpdateMaximumSizeForAllPanels();
92
86 Panels panels_; 93 Panels panels_;
87 94
88 // Stores the panels that are pending to remove. We want to delay the removal 95 // Stores the panels that are pending to remove. We want to delay the removal
89 // when we're in the process of the dragging. 96 // when we're in the process of the dragging.
90 Panels panels_pending_to_remove_; 97 Panels panels_pending_to_remove_;
91 98
92 // Current work area used in computing the panel bounds. 99 // Current work area used in computing the panel bounds.
93 gfx::Rect work_area_; 100 gfx::Rect work_area_;
94 101
95 // Used in computing the bounds of the next panel. 102 // Used in computing the bounds of the next panel.
(...skipping 12 matching lines...) Expand all
108 115
109 // Bounds of the panel to drag. It is first set to the original bounds when 116 // Bounds of the panel to drag. It is first set to the original bounds when
110 // the dragging happens. Then it is updated to the position that will be set 117 // the dragging happens. Then it is updated to the position that will be set
111 // to when the dragging ends. 118 // to when the dragging ends.
112 gfx::Rect dragging_panel_bounds_; 119 gfx::Rect dragging_panel_bounds_;
113 120
114 DISALLOW_COPY_AND_ASSIGN(PanelManager); 121 DISALLOW_COPY_AND_ASSIGN(PanelManager);
115 }; 122 };
116 123
117 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ 124 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698