summaryrefslogtreecommitdiffstats
path: root/views/controls/scroll_view.cc
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 16:45:34 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-30 16:45:34 +0000
commit4a672db19685df00f748681c57a00ee253a2047e (patch)
tree6c64d27e9cdb0ced677f20c0afa4cf084d25e3ee /views/controls/scroll_view.cc
parentbab6cac3c2ad3f335a4694f3ea0b33477a98508b (diff)
downloadchromium_src-4a672db19685df00f748681c57a00ee253a2047e.zip
chromium_src-4a672db19685df00f748681c57a00ee253a2047e.tar.gz
chromium_src-4a672db19685df00f748681c57a00ee253a2047e.tar.bz2
Fixed view example. It was failing because some of view classes requires WidgetGTK in
view hierarchy to call methods on it. * added ContainerExamlpeBase that defers the creation of such views after WidgetGTK available. minor fixes * replaced unnecessary includes with forward decls. * make sure we don't try to set negative hight to viewport. BUG=None TEST=build & run view_examples Review URL: http://codereview.chromium.org/347010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/scroll_view.cc')
-rw-r--r--views/controls/scroll_view.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/views/controls/scroll_view.cc b/views/controls/scroll_view.cc
index a5b5f6a..84ce6c7 100644
--- a/views/controls/scroll_view.cc
+++ b/views/controls/scroll_view.cc
@@ -190,7 +190,8 @@ void ScrollView::Layout() {
// Non-default.
if (horiz_sb_required) {
- viewport_bounds.set_height(viewport_bounds.height() - horiz_sb_height);
+ viewport_bounds.set_height(
+ std::max(0, viewport_bounds.height() - horiz_sb_height));
should_layout_contents = true;
}
// Default.