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

Unified Diff: chrome/browser/ui/panels/panel_manager.h

Issue 7646003: Support auto-hide taskbar for panels 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_manager.h
===================================================================
--- chrome/browser/ui/panels/panel_manager.h (revision 96619)
+++ chrome/browser/ui/panels/panel_manager.h (working copy)
@@ -9,6 +9,7 @@
#include <vector>
#include "base/basictypes.h"
#include "base/memory/scoped_ptr.h"
+#include "base/timer.h"
#include "chrome/browser/ui/panels/panel.h"
#include "ui/gfx/rect.h"
@@ -43,12 +44,20 @@
int mouse_y) const;
// Brings up or down the title-bar for all minimized panels.
- void BringUpOrDownTitleBarForAllMinimizedPanels(bool bring_up);
+ void BringUpTitleBar();
+ void BringDownTitleBar();
+ // Returns the bottom position for the panel per its expansion state. If auto-
+ // hide bottom bar is present, we want to move the minimized panel to the
+ // bottom of the screen, not the bottom of the work area.
Dmitry Titov 2011/08/17 22:56:38 GetBottomPositionForExpansionState would probably
jianli 2011/08/22 20:44:42 Done.
+ int GetBottomPositionPerExpansionState(
+ Panel::ExpansionState expansion_state) const;
+
int num_panels() const { return panels_.size(); }
private:
friend class PanelBrowserTest;
+ friend class PanelBrowserViewTest;
typedef std::vector<Panel*> Panels;
@@ -56,7 +65,7 @@
// Applies the new work area. This is called by OnDisplayChanged and the test
// code.
- void SetWorkArea(const gfx::Rect& work_area);
+ void SetWorkArea(const gfx::Rect& work_area, int bottom_bar_height);
Dmitry Titov 2011/08/17 22:56:38 Comment needs to reflect if this method should be
jianli 2011/08/22 20:44:42 bottom_bar_height argument is removed.
// Handles all the panels that're delayed to be removed.
void DelayedRemove();
@@ -83,6 +92,8 @@
void DragLeft();
void DragRight();
+ void DoBringUpOrDownTitleBar(bool bring_up);
+
Panels panels_;
// Stores the panels that are pending to remove. We want to delay the removal
@@ -90,14 +101,20 @@
Panels panels_pending_to_remove_;
// Current work area used in computing the panel bounds.
+ // If the top-most bottom bar, like Windows taskbar or MacOSX dock, is always
Dmitry Titov 2011/08/17 22:56:38 s/top-most/always-on-top/
jianli 2011/08/22 20:44:42 Done.
+ // visible, it should not be included in the work area. Otherwise, the work
+ // area includes the potential area that would be taken by the bottom bar
+ // when it becomes visible.
gfx::Rect work_area_;
+ // The height of the top-most bottom bar if it is auto-hidden. Otherwise, this
Dmitry Titov 2011/08/17 22:56:38 always-on-top
jianli 2011/08/22 20:44:42 Done.
+ // value is 0.
Dmitry Titov 2011/08/17 22:56:38 This is a dual-use of a variable. It makes reading
jianli 2011/08/22 20:44:42 Removed since it is not needed as I introduced Aut
+ int auto_hide_bottom_bar_height_;
+
// Used in computing the bounds of the next panel.
int max_width_;
int max_height_;
- int min_x_;
int current_x_;
- int bottom_edge_y_;
// Panel to drag.
size_t dragging_panel_index_;
@@ -111,6 +128,13 @@
// to when the dragging ends.
gfx::Rect dragging_panel_bounds_;
+ // Timer to check the visibility of auto-hide bottom bar to decide when to
+ // bring up or down the titlebar.
Dmitry Titov 2011/08/17 22:56:38 s/the titlebar/the panel's titlebars/?
jianli 2011/08/22 20:44:42 Removed since this variable is not needed..
+ base::RepeatingTimer<PanelManager> bring_up_or_down_titlebar_timer_;
+
+ // This is only used by the testing code to disable the above check.
+ bool should_check_auto_hide_bottom_bar_on_titlebar_change_;
Dmitry Titov 2011/08/17 22:56:38 instead of accessing this member directly, we can
jianli 2011/08/22 20:44:42 Done.
+
DISALLOW_COPY_AND_ASSIGN(PanelManager);
};

Powered by Google App Engine
This is Rietveld 408576698