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

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: Final patch to land 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 04144ca063556e2842b38a44c22101fba9a6e922..32ff32c3f284c49308147c28e890a148701dbd0b 100644
--- a/chrome/browser/ui/panels/panel_overflow_strip.h
+++ b/chrome/browser/ui/panels/panel_overflow_strip.h
@@ -50,9 +50,14 @@ 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_; }
+ int current_display_width() const { return current_display_width_; }
+
+ void set_max_visible_panels(int max_visible_panels) {
+ max_visible_panels_ = max_visible_panels;
+ }
#endif
private:
@@ -60,8 +65,11 @@ class PanelOverflowStrip : public 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 UpdateCurrentWidth();
+
void DoRefresh(size_t start_index, size_t end_index);
// Computes the layout of the |index| panel to fit into the area.
@@ -85,6 +93,14 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
// in the panel strip.
gfx::Rect display_area_;
+ // Current width of the overflow area. It is the width of the panel in the
+ // iconified state when the mouse does not hover over it, or the width of
+ // the panel showing more info when the mouse hovers over it.
+ int current_display_width_;
+
+ // 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_;
« no previous file with comments | « chrome/browser/ui/panels/panel_overflow_browsertest.cc ('k') | chrome/browser/ui/panels/panel_overflow_strip.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698