| 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 "base/timer.h" |
| 14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" | 14 #include "chrome/browser/ui/panels/auto_hiding_desktop_bar.h" |
| 15 #include "chrome/browser/ui/panels/panel.h" | 15 #include "chrome/browser/ui/panels/panel.h" |
| 16 #include "ui/gfx/rect.h" | 16 #include "ui/gfx/rect.h" |
| 17 | 17 |
| 18 class Browser; | 18 class Browser; |
| 19 class PanelMouseWatcher; | 19 class PanelMouseWatcher; |
| 20 class PanelOverflowStrip; | 20 class PanelOverflowStrip; |
| 21 class PanelStrip; | 21 class PanelStrip; |
| 22 | 22 |
| 23 // This class manages a set of panels. | 23 // This class manages a set of panels. |
| 24 class PanelManager : public AutoHidingDesktopBar::Observer { | 24 class PanelManager : public AutoHidingDesktopBar::Observer { |
| 25 public: | 25 public: |
| 26 typedef std::vector<Panel*> Panels; | |
| 27 | |
| 28 // Returns a single instance. | 26 // Returns a single instance. |
| 29 static PanelManager* GetInstance(); | 27 static PanelManager* GetInstance(); |
| 30 | 28 |
| 31 // Returns true if panels should be used for the extension. | 29 // Returns true if panels should be used for the extension. |
| 32 static bool ShouldUsePanels(const std::string& extension_id); | 30 static bool ShouldUsePanels(const std::string& extension_id); |
| 33 | 31 |
| 34 // Called when the display is changed, i.e. work area is updated. | 32 // Called when the display is changed, i.e. work area is updated. |
| 35 void OnDisplayChanged(); | 33 void OnDisplayChanged(); |
| 36 | 34 |
| 37 // Creates a panel and returns it. The panel might be queued for display | 35 // Creates a panel and returns it. The panel might be queued for display |
| (...skipping 27 matching lines...) Expand all Loading... |
| 65 // Brings up or down the titlebars for all minimized panels. | 63 // Brings up or down the titlebars for all minimized panels. |
| 66 void BringUpOrDownTitlebars(bool bring_up); | 64 void BringUpOrDownTitlebars(bool bring_up); |
| 67 | 65 |
| 68 // Returns the next browser window which could be either panel window or | 66 // Returns the next browser window which could be either panel window or |
| 69 // tabbed window, to switch to if the given panel is going to be deactivated. | 67 // tabbed window, to switch to if the given panel is going to be deactivated. |
| 70 // Returns NULL if such window cannot be found. | 68 // Returns NULL if such window cannot be found. |
| 71 BrowserWindow* GetNextBrowserWindowToActivate(Panel* panel) const; | 69 BrowserWindow* GetNextBrowserWindowToActivate(Panel* panel) const; |
| 72 | 70 |
| 73 int num_panels() const; | 71 int num_panels() const; |
| 74 int StartingRightPosition() const; | 72 int StartingRightPosition() const; |
| 75 const Panels& panels() const; | 73 std::vector<Panel*> panels() const; |
| 76 | 74 |
| 77 AutoHidingDesktopBar* auto_hiding_desktop_bar() const { | 75 AutoHidingDesktopBar* auto_hiding_desktop_bar() const { |
| 78 return auto_hiding_desktop_bar_; | 76 return auto_hiding_desktop_bar_; |
| 79 } | 77 } |
| 80 | 78 |
| 81 PanelMouseWatcher* mouse_watcher() const { | 79 PanelMouseWatcher* mouse_watcher() const { |
| 82 return panel_mouse_watcher_.get(); | 80 return panel_mouse_watcher_.get(); |
| 83 } | 81 } |
| 84 | 82 |
| 85 PanelStrip* panel_strip() const { | 83 PanelStrip* panel_strip() const { |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 // Timer used to track if the current active app is in full screen mode. | 184 // Timer used to track if the current active app is in full screen mode. |
| 187 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; | 185 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; |
| 188 | 186 |
| 189 // True if current active app is in full screen mode. | 187 // True if current active app is in full screen mode. |
| 190 bool is_full_screen_; | 188 bool is_full_screen_; |
| 191 | 189 |
| 192 DISALLOW_COPY_AND_ASSIGN(PanelManager); | 190 DISALLOW_COPY_AND_ASSIGN(PanelManager); |
| 193 }; | 191 }; |
| 194 | 192 |
| 195 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ | 193 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ |
| OLD | NEW |