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.
5 #ifndef CHROME_BROWSER_UI_PANELS_DISPLAY_SETTINGS_PROVIDER_WIN_H_
6 #define CHROME_BROWSER_UI_PANELS_DISPLAY_SETTINGS_PROVIDER_WIN_H_
8 #include "chrome/browser/ui/panels/display_settings_provider.h"
11 #include "base/compiler_specific.h"
12 #include "base/timer/timer.h"
14 class DisplaySettingsProviderWin
: public DisplaySettingsProvider
{
16 DisplaySettingsProviderWin();
17 virtual ~DisplaySettingsProviderWin();
20 // Overridden from DisplaySettingsProvider:
21 virtual void OnDisplaySettingsChanged() OVERRIDE
;
22 virtual bool IsAutoHidingDesktopBarEnabled(
23 DesktopBarAlignment alignment
) OVERRIDE
;
24 virtual int GetDesktopBarThickness(
25 DesktopBarAlignment alignment
) const OVERRIDE
;
26 virtual DesktopBarVisibility
GetDesktopBarVisibility(
27 DesktopBarAlignment alignment
) const OVERRIDE
;
29 int GetDesktopBarThicknessFromBounds(
30 DesktopBarAlignment alignment
, const gfx::Rect
& taskbar_bounds
) const;
31 DesktopBarVisibility
GetDesktopBarVisibilityFromBounds(
32 DesktopBarAlignment alignment
, const gfx::Rect
& taskbar_bounds
) const;
37 DesktopBarVisibility visibility
;
41 // Callback to perform periodic check for taskbar changes.
42 void OnPollingTimer();
44 // Returns true if there is at least one auto-hiding taskbar found.
45 bool CheckTaskbars(bool notify_observer
);
47 gfx::Rect
GetBounds(DesktopBarAlignment alignment
) const;
49 // Maximum number of taskbars we're interested in: bottom, left, and right.
50 static const int kMaxTaskbars
= 3;
53 Taskbar taskbars_
[kMaxTaskbars
];
54 base::RepeatingTimer
<DisplaySettingsProviderWin
> polling_timer_
;
56 DISALLOW_COPY_AND_ASSIGN(DisplaySettingsProviderWin
);
59 #endif // CHROME_BROWSER_UI_PANELS_DISPLAY_SETTINGS_PROVIDER_WIN_H_