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

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

Issue 8872044: Add test cases for panel overflow handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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_overflow_strip.h
diff --git a/chrome/browser/ui/panels/panel_overflow_strip.h b/chrome/browser/ui/panels/panel_overflow_strip.h
index 0dab64d9e21054d7090ccd8f2c2268a659ab5b07..1fbd12a5d2d442e713b9853b1dea0d2fb1c2ff18 100644
--- a/chrome/browser/ui/panels/panel_overflow_strip.h
+++ b/chrome/browser/ui/panels/panel_overflow_strip.h
@@ -51,16 +51,28 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
Panel* first_panel() const {
return panels_.empty() ? NULL : panels_.front();
}
+ const Panels& panels() const { return panels_; }
#ifdef UNIT_TEST
- const Panels& panels() const { return panels_; }
+ void set_max_visible_panels(int max_visible_panels) {
+ max_visible_panels_ = max_visible_panels;
+ }
+
+ bool TestShouldShowOverflowTitles(const gfx::Point& mouse_position) const {
jennb 2011/12/08 23:52:00 Use a TestPanelMouseWatcher instance and simulate
jianli 2011/12/09 22:39:07 I've already used TestPanelMouseWatcher that. But
+ return ShouldShowOverflowTitles(mouse_position);
+ }
#endif
+ // The width of the overflow area that is expanded to show more info, i.e.
+ // titles, when the mouse hovers over the area.
+ static const int kOverflowAreaHoverWidth = 200;
+
private:
// Overridden from PanelMouseWatcherObserver:
virtual void OnMouseMove(const gfx::Point& mouse_position) OVERRIDE;
// Overridden from AnimationDelegate:
+ virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE;
virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
void DoRefresh(size_t start_index, size_t end_index);
@@ -86,6 +98,9 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
// in the panel strip.
gfx::Rect display_area_;
+ // Maximium number of overflow panels allowed to be shown.
+ int max_visible_panels_;
+
// For mouse hover-over effect.
bool are_overflow_titles_shown_;
scoped_ptr<ui::SlideAnimation> overflow_hover_animator_;

Powered by Google App Engine
This is Rietveld 408576698