Add a minor text member to ui::MenuModel.
[chromium-blink-merge.git] / chrome / browser / ui / panels / display_settings_provider_win.h
blob75b06741ea88a89177dfa151b82798e35806bdba
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"
10 #include <windows.h>
11 #include "base/compiler_specific.h"
12 #include "base/timer/timer.h"
14 class DisplaySettingsProviderWin : public DisplaySettingsProvider {
15 public:
16 DisplaySettingsProviderWin();
17 virtual ~DisplaySettingsProviderWin();
19 protected:
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;
34 private:
35 struct Taskbar {
36 HWND window;
37 DesktopBarVisibility visibility;
38 int thickness;
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;
52 HMONITOR monitor_;
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_