| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "views/controls/single_split_view.h" | 5 #include "views/controls/single_split_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
| 8 #include <gdk/gdk.h> | 8 #include <gdk/gdk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "gfx/canvas.h" | |
| 12 #include "skia/ext/skia_utils_win.h" | 11 #include "skia/ext/skia_utils_win.h" |
| 12 #include "ui/gfx/canvas.h" |
| 13 #include "views/background.h" | 13 #include "views/background.h" |
| 14 | 14 |
| 15 #if defined(OS_LINUX) | 15 #if defined(OS_LINUX) |
| 16 #include "gfx/gtk_util.h" | 16 #include "ui/gfx/gtk_util.h" |
| 17 #endif | 17 #endif |
| 18 | 18 |
| 19 namespace views { | 19 namespace views { |
| 20 | 20 |
| 21 // Size of the divider in pixels. | 21 // Size of the divider in pixels. |
| 22 static const int kDividerSize = 4; | 22 static const int kDividerSize = 4; |
| 23 | 23 |
| 24 SingleSplitView::SingleSplitView(View* leading, | 24 SingleSplitView::SingleSplitView(View* leading, |
| 25 View* trailing, | 25 View* trailing, |
| 26 Orientation orientation, | 26 Orientation orientation, |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 int SingleSplitView::NormalizeDividerOffset(int divider_offset, | 238 int SingleSplitView::NormalizeDividerOffset(int divider_offset, |
| 239 const gfx::Rect& bounds) const { | 239 const gfx::Rect& bounds) const { |
| 240 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); | 240 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); |
| 241 if (divider_offset < 0) | 241 if (divider_offset < 0) |
| 242 return (primary_axis_size - kDividerSize) / 2; | 242 return (primary_axis_size - kDividerSize) / 2; |
| 243 return std::min(divider_offset, | 243 return std::min(divider_offset, |
| 244 std::max(primary_axis_size - kDividerSize, 0)); | 244 std::max(primary_axis_size - kDividerSize, 0)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 } // namespace views | 247 } // namespace views |
| OLD | NEW |