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

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

Issue 8953040: Add overflow indicator count on Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix trybot 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 32ff32c3f284c49308147c28e890a148701dbd0b..4b63ceb6f62b5e1c2a2528ec66f6d829407fbb4f 100644
--- a/chrome/browser/ui/panels/panel_overflow_strip.h
+++ b/chrome/browser/ui/panels/panel_overflow_strip.h
@@ -13,6 +13,7 @@
class Browser;
class PanelManager;
+class PanelOverflowIndicator;
namespace ui {
class SlideAnimation;
}
@@ -41,6 +42,9 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
void OnPanelExpansionStateChanged(
Panel* panel, Panel::ExpansionState old_state);
+ // Called when a panel is starting/stopping drawing an attention.
+ void OnPanelAttentionStateChanged(Panel* panel);
+
// Refreshes the layouts for all panels to reflect any possible changes.
void Refresh();
@@ -55,9 +59,18 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
#ifdef UNIT_TEST
int current_display_width() const { return current_display_width_; }
+ // This might return NULL.
+ PanelOverflowIndicator* overflow_indicator() const {
+ return overflow_indicator_.get();
+ }
+
void set_max_visible_panels(int max_visible_panels) {
max_visible_panels_ = max_visible_panels;
}
+
+ void set_max_visible_panels_on_hover(int max_visible_panels_on_hover) {
+ max_visible_panels_on_hover_ = max_visible_panels_on_hover;
+ }
#endif
private:
@@ -72,6 +85,11 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
void DoRefresh(size_t start_index, size_t end_index);
+ // Used to update the overflow indicator.
+ void UpdateMaxVisiblePanelsOnHover();
+ void UpdateOverflowIndicatorCount();
+ void UpdateOverflowIndicatorAttention();
+
// Computes the layout of the |index| panel to fit into the area.
// Empty bounds will be returned if this is not possible due to not enough
// space.
@@ -83,6 +101,11 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
bool ShouldShowOverflowTitles(const gfx::Point& mouse_position) const;
void ShowOverflowTitles(bool show_overflow_titles);
+ int max_visible_panels() const {
+ return are_overflow_titles_shown_ ? max_visible_panels_on_hover_
+ : max_visible_panels_;
+ }
+
// Weak pointer since PanelManager owns PanelOverflowStrip instance.
PanelManager* panel_manager_;
@@ -98,9 +121,18 @@ class PanelOverflowStrip : public PanelMouseWatcherObserver,
// the panel showing more info when the mouse hovers over it.
int current_display_width_;
- // Maximium number of overflow panels allowed to be shown.
+ // Maximium number of overflow panels allowed to be shown when the mouse
+ // does not hover over the overflow area.
int max_visible_panels_;
+ // Maximium number of overflow panels allowed to be shown when the mouse
+ // hovers over the overflow area and causes it to be expanded.
+ int max_visible_panels_on_hover_;
+
+ // Used to show "+N" indicator when number of overflow panels exceed
+ // |max_visible_panels_|.
+ scoped_ptr<PanelOverflowIndicator> overflow_indicator_;
+
// 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_indicator_view.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