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

Unified Diff: chrome/browser/ui/toolbar/toolbar_actions_bar.h

Issue 1330423003: [Extensions Toolbar] Protect against crazy bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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/toolbar/toolbar_actions_bar.h
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_bar.h b/chrome/browser/ui/toolbar/toolbar_actions_bar.h
index 2e78ef387ce2eea9ee5504ecc69c2f9f54453679..5da8b241437175f770af9764d42eddc8af1c99e6 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_bar.h
+++ b/chrome/browser/ui/toolbar/toolbar_actions_bar.h
@@ -101,9 +101,19 @@ class ToolbarActionsBar : public ToolbarActionsModel::Observer {
// Returns the number of icons that can fit within the given width.
size_t WidthToIconCount(int width) const;
- // Returns the number of icons that should be displayed.
+ // Returns the number of icons that should be displayed if space allows.
size_t GetIconCount() const;
+ // Returns the starting index (inclusive) for displayable icons.
+ size_t GetStartIndexInBounds() const;
+
+ // Returns the ending index (exclusive) for displayable icons.
+ size_t GetEndIndexInBounds() const;
+
+ // Returns true if an overflow container is necessary to display any other
+ // icons.
+ bool NeedsOverflow() const;
+
// Returns the frame (bounds) that the specified index should have, taking
// into account if this is the main or overflow bar. If this is the overflow
// bar and the index should not be displayed (i.e., it is shown on the main

Powered by Google App Engine
This is Rietveld 408576698