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

Side by Side Diff: chrome/browser/ui/panels/panel_manager.h

Issue 8872044: Add test cases for panel overflow handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 9 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 // Called when the display is changed, i.e. work area is updated. 29 // Called when the display is changed, i.e. work area is updated.
32 void OnDisplayChanged(); 30 void OnDisplayChanged();
33 31
34 // Creates a panel and returns it. The panel might be queued for display 32 // Creates a panel and returns it. The panel might be queued for display
35 // later. 33 // later.
36 Panel* CreatePanel(Browser* browser); 34 Panel* CreatePanel(Browser* browser);
37 35
(...skipping 24 matching lines...) Expand all
62 // Brings up or down the titlebars for all minimized panels. 60 // Brings up or down the titlebars for all minimized panels.
63 void BringUpOrDownTitlebars(bool bring_up); 61 void BringUpOrDownTitlebars(bool bring_up);
64 62
65 // Returns the next browser window which could be either panel window or 63 // Returns the next browser window which could be either panel window or
66 // tabbed window, to switch to if the given panel is going to be deactivated. 64 // tabbed window, to switch to if the given panel is going to be deactivated.
67 // Returns NULL if such window cannot be found. 65 // Returns NULL if such window cannot be found.
68 BrowserWindow* GetNextBrowserWindowToActivate(Panel* panel) const; 66 BrowserWindow* GetNextBrowserWindowToActivate(Panel* panel) const;
69 67
70 int num_panels() const; 68 int num_panels() const;
71 int StartingRightPosition() const; 69 int StartingRightPosition() const;
72 const Panels& panels() const; 70 std::vector<Panel*> panels() const;
73 71
74 AutoHidingDesktopBar* auto_hiding_desktop_bar() const { 72 AutoHidingDesktopBar* auto_hiding_desktop_bar() const {
75 return auto_hiding_desktop_bar_; 73 return auto_hiding_desktop_bar_;
76 } 74 }
77 75
78 PanelMouseWatcher* mouse_watcher() const { 76 PanelMouseWatcher* mouse_watcher() const {
79 return panel_mouse_watcher_.get(); 77 return panel_mouse_watcher_.get();
80 } 78 }
81 79
82 PanelStrip* panel_strip() const { 80 PanelStrip* panel_strip() const {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Timer used to track if the current active app is in full screen mode. 165 // Timer used to track if the current active app is in full screen mode.
168 base::RepeatingTimer<PanelManager> full_screen_mode_timer_; 166 base::RepeatingTimer<PanelManager> full_screen_mode_timer_;
169 167
170 // True if current active app is in full screen mode. 168 // True if current active app is in full screen mode.
171 bool is_full_screen_; 169 bool is_full_screen_;
172 170
173 DISALLOW_COPY_AND_ASSIGN(PanelManager); 171 DISALLOW_COPY_AND_ASSIGN(PanelManager);
174 }; 172 };
175 173
176 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_ 174 #endif // CHROME_BROWSER_UI_PANELS_PANEL_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698