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

Unified Diff: views/controls/single_split_view.cc

Issue 7846010: Fixed crash when a SinglesplitView gets embdedded inside SingleSplitView (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 9 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: views/controls/single_split_view.cc
diff --git a/views/controls/single_split_view.cc b/views/controls/single_split_view.cc
index 5addbb9186014c56a3cce95d8918c8d24c02d58c..44e2c2dd1c8cd337edce1d1eb6fed88ce85efb30 100644
--- a/views/controls/single_split_view.cc
+++ b/views/controls/single_split_view.cc
@@ -246,7 +246,10 @@ int SingleSplitView::NormalizeDividerOffset(int divider_offset,
const gfx::Rect& bounds) const {
int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height());
if (divider_offset < 0)
- return (primary_axis_size - kDividerSize) / 2;
+ // Prevents negative check fail in gfx:Size()for embedded SingleSplitView
tfarina 2011/09/08 20:39:45 add space between gfx::Size() and for and "for an
Gajen 2011/09/09 13:58:02 Done.
+ // on very first Layout.
+ return std::max(0, ((primary_axis_size - kDividerSize) / 2));
tfarina 2011/09/08 20:39:45 is there an extra (unnecessary) parentheses around
Gajen 2011/09/09 13:58:02 Done.
+
return std::min(divider_offset,
sky 2011/09/08 14:27:11 Put the std::max call here, eg std::max(0, divider
std::max(primary_axis_size - kDividerSize, 0));
}

Powered by Google App Engine
This is Rietveld 408576698