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

Unified Diff: chrome/browser/ui/panels/panel_manager.h

Issue 8827011: Panel strip refactor cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_manager.h
diff --git a/chrome/browser/ui/panels/panel_manager.h b/chrome/browser/ui/panels/panel_manager.h
index b78cb9e9b3e9a96ab1ba555589c52f4c50652c42..5eac61550669325303e7a4a9d7000558d160cb61 100644
--- a/chrome/browser/ui/panels/panel_manager.h
+++ b/chrome/browser/ui/panels/panel_manager.h
@@ -15,13 +15,6 @@
#include "chrome/browser/ui/panels/panel.h"
#include "ui/gfx/rect.h"
-// TODO(jennb): Clean up by removing functions below that cause this
-// to be required.
-#ifdef UNIT_TEST
-#include "chrome/browser/ui/panels/panel_strip.h"
-#include "chrome/browser/ui/panels/panel_mouse_watcher.h"
-#endif
-
class Browser;
class PanelMouseWatcher;
class PanelOverflowStrip;
@@ -75,7 +68,6 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
BrowserWindow* GetNextBrowserWindowToActivate(Panel* panel) const;
int num_panels() const;
- bool is_dragging_panel() const;
int StartingRightPosition() const;
const Panels& panels() const;
@@ -97,40 +89,32 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
}
#ifdef UNIT_TEST
- static int horizontal_spacing() { return PanelStrip::horizontal_spacing(); }
-
- const gfx::Rect& work_area() const {
- return work_area_;
- }
-
void set_auto_hiding_desktop_bar(
AutoHidingDesktopBar* auto_hiding_desktop_bar) {
auto_hiding_desktop_bar_ = auto_hiding_desktop_bar;
}
- void set_mouse_watcher(PanelMouseWatcher* watcher) {
- panel_mouse_watcher_.reset(watcher);
- }
-
void enable_auto_sizing(bool enabled) {
auto_sizing_enabled_ = enabled;
}
- void SetWorkAreaForTesting(const gfx::Rect& work_area) {
- SetWorkArea(work_area);
- }
-
- void remove_delays_for_testing() {
- panel_strip_->remove_delays_for_testing();
+ const gfx::Rect& work_area() const {
+ return work_area_;
}
- int minimized_panel_count() {
- return panel_strip_->minimized_panel_count();
+ void SetWorkAreaForTesting(const gfx::Rect& work_area) {
+ SetWorkArea(work_area);
}
#endif
private:
friend struct base::DefaultLazyInstanceTraits<PanelManager>;
+ friend class PanelBrowserTest; // for SetMouseWatcher()
jianli 2011/12/08 00:27:54 As discussed, we can do sth. similar to SetWorkAre
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, DrawAttentionWhileMinimized);
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, MinimizeRestore);
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, MinimizeRestoreTwoPanels);
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, MinimizeRestoreThreePanels);
+ FRIEND_TEST_ALL_PREFIXES(PanelBrowserTest, RestoredBounds);
PanelManager();
virtual ~PanelManager();
@@ -154,6 +138,9 @@ class PanelManager : public AutoHidingDesktopBar::Observer {
// Tests if the current active app is in full screen mode.
void CheckFullScreenMode();
+ // Tests may want to use a mock panel mouse watcher.
+ void SetMouseWatcher(PanelMouseWatcher* watcher);
+
scoped_ptr<PanelStrip> panel_strip_;
scoped_ptr<PanelOverflowStrip> panel_overflow_strip_;

Powered by Google App Engine
This is Rietveld 408576698