| OLD | NEW |
| 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" |
| 11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/timer.h" |
| 13 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" | 14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" |
| 14 #include "chrome/browser/ui/panels/panel.h" | 15 #include "chrome/browser/ui/panels/panel.h" |
| 15 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 16 | 17 |
| 17 // TODO(jennb): Clean up by removing functions below that cause this | 18 // TODO(jennb): Clean up by removing functions below that cause this |
| 18 // to be required. | 19 // to be required. |
| 19 #ifdef UNIT_TEST | 20 #ifdef UNIT_TEST |
| 20 #include "chrome/browser/ui/panels/panel_strip.h" | 21 #include "chrome/browser/ui/panels/panel_strip.h" |
| 21 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" | 22 #include "chrome/browser/ui/panels/panel_mouse_watcher.h" |
| 22 #endif | 23 #endif |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 94 } |
| 94 | 95 |
| 95 PanelMouseWatcher* mouse_watcher() const { | 96 PanelMouseWatcher* mouse_watcher() const { |
| 96 return panel_mouse_watcher_.get(); | 97 return panel_mouse_watcher_.get(); |
| 97 } | 98 } |
| 98 | 99 |
| 99 PanelStrip* panel_strip() const { | 100 PanelStrip* panel_strip() const { |
| 100 return panel_strip_.get(); | 101 return panel_strip_.get(); |
| 101 } | 102 } |
| 102 | 103 |
| 104 bool is_full_screen() const { return is_full_screen_; } |
| 105 |
| 103 #ifdef UNIT_TEST | 106 #ifdef UNIT_TEST |
| 104 static int horizontal_spacing() { return PanelStrip::horizontal_spacing(); } | 107 static int horizontal_spacing() { return PanelStrip::horizontal_spacing(); } |
| 105 | 108 |
| 106 const gfx::Rect& work_area() const { | 109 const gfx::Rect& work_area() const { |
| 107 return work_area_; | 110 return work_area_; |
| 108 } | 111 } |
| 109 | 112 |
| 110 void set_auto_hiding_desktop_bar( | 113 void set_auto_hiding_desktop_bar( |
| 111 AutoHidingDesktopBar* auto_hiding_desktop_bar) { | 114 AutoHidingDesktopBar* auto_hiding_desktop_bar) { |
| 112 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; | 115 auto_hiding_desktop_bar_ = auto_hiding_desktop_bar; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 // Applies the new work area. This is called by OnDisplayChanged and the test | 151 // Applies the new work area. This is called by OnDisplayChanged and the test |
| 149 // code. | 152 // code. |
| 150 void SetWorkArea(const gfx::Rect& work_area); | 153 void SetWorkArea(const gfx::Rect& work_area); |
| 151 | 154 |
| 152 // Adjusts the work area to exclude the influence of auto-hiding desktop bars. | 155 // Adjusts the work area to exclude the influence of auto-hiding desktop bars. |
| 153 void AdjustWorkAreaForAutoHidingDesktopBars(); | 156 void AdjustWorkAreaForAutoHidingDesktopBars(); |
| 154 | 157 |
| 155 // Positions the various groupings of panels. | 158 // Positions the various groupings of panels. |
| 156 void Layout(); | 159 void Layout(); |
| 157 | 160 |
| 161 // Tests if the current active app is in full screen mode. |
| 162 void CheckFullScreenMode(); |
| 163 |
| 158 scoped_ptr<PanelStrip> panel_strip_; | 164 scoped_ptr<PanelStrip> panel_strip_; |
| 159 | 165 |
| 160 // Use a mouse watcher to know when to bring up titlebars to "peek" at | 166 // Use a mouse watcher to know when to bring up titlebars to "peek" at |
| 161 // minimized panels. Mouse movement is only tracked when there is a minimized | 167 // minimized panels. Mouse movement is only tracked when there is a minimized |
| 162 // panel. | 168 // panel. |
| 163 scoped_ptr<PanelMouseWatcher> panel_mouse_watcher_; | 169 scoped_ptr<PanelMouseWatcher> panel_mouse_watcher_; |
| 164 | 170 |
| 165 // The maximum work area avaialble. This area does not include the area taken | 171 // The maximum work area avaialble. This area does not include the area taken |
| 166 // by the always-visible (non-auto-hiding) desktop bars. | 172 // by the always-visible (non-auto-hiding) desktop bars. |
| 167 gfx::Rect work_area_; | 173 gfx::Rect work_area_; |
| 168 | 174 |
| 169 // The useable work area for computing the panel bounds. This area excludes | 175 // The useable work area for computing the panel bounds. This area excludes |
| 170 // the potential area that could be taken by the auto-hiding desktop | 176 // the potential area that could be taken by the auto-hiding desktop |
| 171 // bars (we only consider those bars that are aligned to bottom, left, and | 177 // bars (we only consider those bars that are aligned to bottom, left, and |
| 172 // right of the screen edges) when they become fully visible. | 178 // right of the screen edges) when they become fully visible. |
| 173 gfx::Rect adjusted_work_area_; | 179 gfx::Rect adjusted_work_area_; |
| 174 | 180 |
| 175 scoped_refptr<AutoHidingDesktopBar> auto_hiding_desktop_bar_; | 181 scoped_refptr<AutoHidingDesktopBar> auto_hiding_desktop_bar_; |
| 176 | 182 |
| 177 // Whether or not bounds will be updated when the preferred content size is | 183 // Whether or not bounds will be updated when the preferred content size is |
| 178 // changed. The testing code could set this flag to false so that other tests | 184 // changed. The testing code could set this flag to false so that other tests |
| 179 // will not be affected. | 185 // will not be affected. |
| 180 bool auto_sizing_enabled_; | 186 bool auto_sizing_enabled_; |
| 181 | 187 |
| 188 // Timer used to track if the current active app is in full screen mode. |
| 189 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; |
| 190 |
| 191 // True if current active app is in full screen mode. |
| 192 bool is_full_screen_; |
| 193 |
| 182 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 194 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
| 183 }; | 195 }; |
| 184 | 196 |
| 185 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 197 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
| OLD | NEW |