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

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

Issue 8341098: Mac: Added a delay before panels go to minimized state from title-only state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 145
146 // Rearranges the positions of the panels starting from the given iterator. 146 // Rearranges the positions of the panels starting from the given iterator.
147 // This is called when the display space has been changed, i.e. working 147 // This is called when the display space has been changed, i.e. working
148 // area being changed or a panel being closed. 148 // area being changed or a panel being closed.
149 void Rearrange(Panels::iterator iter_to_start, int rightmost_position); 149 void Rearrange(Panels::iterator iter_to_start, int rightmost_position);
150 150
151 // Help functions to drag the given panel. 151 // Help functions to drag the given panel.
152 void DragLeft(); 152 void DragLeft();
153 void DragRight(); 153 void DragRight();
154 154
155 // Checks if the titlebars have been brought up or down. If not, do not wait
156 // for the notifications to trigger it any more, and start to bring them up or
157 // down immediately.
158 void DelayedBringUpOrDownTitlebarsCheck();
159
160 // Does the real job of bringing up or down the titlebars. 155 // Does the real job of bringing up or down the titlebars.
161 void DoBringUpOrDownTitlebars(bool bring_up); 156 void DoBringUpOrDownTitlebars(bool bring_up);
162 157
163 int GetMaxPanelWidth() const; 158 int GetMaxPanelWidth() const;
164 int GetMaxPanelHeight() const; 159 int GetMaxPanelHeight() const;
165 int GetRightMostAvailablePosition() const; 160 int GetRightMostAvailablePosition() const;
166 161
167 Panels panels_; 162 Panels panels_;
168 163
169 // Stores the panels that are pending to remove. We want to delay the removal 164 // Stores the panels that are pending to remove. We want to delay the removal
(...skipping 24 matching lines...) Expand all
194 // the original position when we cancel the dragging. 189 // the original position when we cancel the dragging.
195 int dragging_panel_original_x_; 190 int dragging_panel_original_x_;
196 191
197 // Bounds of the panel to drag. It is first set to the original bounds when 192 // Bounds of the panel to drag. It is first set to the original bounds when
198 // the dragging happens. Then it is updated to the position that will be set 193 // the dragging happens. Then it is updated to the position that will be set
199 // to when the dragging ends. 194 // to when the dragging ends.
200 gfx::Rect dragging_panel_bounds_; 195 gfx::Rect dragging_panel_bounds_;
201 196
202 scoped_refptr<AutoHidingDesktopBar> auto_hiding_desktop_bar_; 197 scoped_refptr<AutoHidingDesktopBar> auto_hiding_desktop_bar_;
203 198
199 // Delayed transitions support. Sometimes transitions between minimized and
200 // title-only states are delayed, for better usability with Taskbars/Docks.
204 TitlebarAction delayed_titlebar_action_; 201 TitlebarAction delayed_titlebar_action_;
205 202 static int sLastTaskIndex;
jianli 2011/10/28 01:04:11 The variable name does not follow the coding style
Dmitry Titov 2011/10/28 20:58:23 Fixed style. Tried to figure out simple way that w
206 ScopedRunnableMethodFactory<PanelManager> method_factory_; 203 ScopedRunnableMethodFactory<PanelManager> method_factory_;
204 void DelayedBringUpOrDownTitlebarsCheck(int taskIndex);
207 205
208 // Whether or not bounds will be updated when the preferred content size is 206 // Whether or not bounds will be updated when the preferred content size is
209 // changed. The testing code could set this flag to false so that other tests 207 // changed. The testing code could set this flag to false so that other tests
210 // will not be affected. 208 // will not be affected.
211 bool auto_sizing_enabled_; 209 bool auto_sizing_enabled_;
212 210
213 bool mouse_watching_disabled_; // For tests to simulate mouse movements. 211 bool mouse_watching_disabled_; // For tests to simulate mouse movements.
214 212
215 static const int kPanelsHorizontalSpacing = 4; 213 static const int kPanelsHorizontalSpacing = 4;
216 214
217 // Minimum width and height of a panel. 215 // Minimum width and height of a panel.
218 // Note: The minimum size of a widget (see widget.cc) is fixed to 100x100. 216 // Note: The minimum size of a widget (see widget.cc) is fixed to 100x100.
219 // TODO(jianli): Need to fix this to support smaller panel. 217 // TODO(jianli): Need to fix this to support smaller panel.
220 static const int kPanelMinWidth = 100; 218 static const int kPanelMinWidth = 100;
221 static const int kPanelMinHeight = 100; 219 static const int kPanelMinHeight = 100;
222 220
223 DISALLOW_COPY_AND_ASSIGN(PanelManager); 221 DISALLOW_COPY_AND_ASSIGN(PanelManager);
224 }; 222 };
225 223
226 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ 224 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/panel_manager.cc » ('j') | chrome/browser/ui/panels/panel_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698