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

Unified Diff: chrome/browser/ui/panels/auto_hiding_desktop_bar.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
« no previous file with comments | « no previous file | chrome/browser/ui/panels/auto_hiding_desktop_bar_chromeos.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/panels/auto_hiding_desktop_bar.h
===================================================================
--- chrome/browser/ui/panels/auto_hiding_desktop_bar.h (revision 0)
+++ chrome/browser/ui/panels/auto_hiding_desktop_bar.h (revision 0)
@@ -0,0 +1,72 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_PANELS_AUTO_HIDING_DESKTOP_BAR_H_
+#define CHROME_BROWSER_UI_PANELS_AUTO_HIDING_DESKTOP_BAR_H_
+#pragma once
+
+#include "base/memory/ref_counted.h"
+
+namespace gfx {
+class Rect;
+}
+
+// Encapsulates the logic to deal with always-on-top auto-hiding desktop bars,
+// like Windows taskbar or MacOSX dock.
+// Note that the ref count is needed by using PostTask in the implementation of
+// MockAutoHidingDesktopBar that derives from AutoHidingDesktopBar.
+class AutoHidingDesktopBar : public base::RefCounted<AutoHidingDesktopBar> {
+ public:
+ // Indicates which screen edge the desktop bar is aligned to.
+ // We do not care about the desktop aligned to the top screen edge.
+ enum Alignment {
+ ALIGN_BOTTOM = 0,
+ ALIGN_LEFT = 1,
+ ALIGN_RIGHT = 2
+ };
+
+ enum Visibility {
+ VISIBLE,
+ ANIMATING,
+ HIDDEN
+ };
+
+ // Observer can listen to various events regarding the desktop bar changes.
+ class Observer {
+ public:
+ // Called when any of the desktop bars get their thickness changed.
+ // Note that if an auto-hiding desktop bar is moved from one edge
+ // to another edge, it will cause thickness changes to both edges.
+ virtual void OnAutoHidingDesktopBarThicknessChanged() = 0;
+
+ // Called when an auto-hiding desktop bar has its visibility changed.
+ virtual void OnAutoHidingDesktopBarVisibilityChanged(
+ Alignment alignment, Visibility visibility) = 0;
+ };
+
+ static AutoHidingDesktopBar* Create(Observer* observer);
+
+ virtual ~AutoHidingDesktopBar() { }
+
+ // This should be called each time when the work area is changed. We only
+ // care about the desktop bars that sit on the screen that hosts the specified
+ // work area.
+ virtual void UpdateWorkArea(const gfx::Rect& work_area) = 0;
+
+ // Returns true if there is a desktop bar that is aligned to the specified
+ // screen edge and set to auto-hide.
+ virtual bool IsEnabled(Alignment alignment) = 0;
+
+ // Returns the thickness of the desktop bar that is aligned to the specified
+ // screen edge, when it is visible. When the desktop bar is aligned to bottom
+ // edge, this is the height of the bar. If the desktop bar is aligned to
+ // left or right edge, this is the width of the bar.
+ virtual int GetThickness(Alignment alignment) const = 0;
+
+ // Returns the visibility state of the desktop bar that is aligned to the
+ // specified screen edge.
+ virtual Visibility GetVisibility(Alignment alignment) const = 0;
+};
+
+#endif // CHROME_BROWSER_UI_PANELS_AUTO_HIDING_DESKTOP_BAR_H_
Property changes on: chrome\browser\ui\panels\auto_hiding_desktop_bar.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « no previous file | chrome/browser/ui/panels/auto_hiding_desktop_bar_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698