OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/controls/single_split_view.h" | 5 #include "ui/views/controls/single_split_view.h" |
6 | 6 |
7 #include "skia/ext/skia_utils_win.h" | |
8 #include "ui/accessibility/ax_view_state.h" | 7 #include "ui/accessibility/ax_view_state.h" |
9 #include "ui/base/cursor/cursor.h" | 8 #include "ui/base/cursor/cursor.h" |
10 #include "ui/gfx/canvas.h" | 9 #include "ui/gfx/canvas.h" |
11 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
12 #include "ui/views/controls/single_split_view_listener.h" | 11 #include "ui/views/controls/single_split_view_listener.h" |
13 #include "ui/views/native_cursor.h" | 12 #include "ui/views/native_cursor.h" |
14 | 13 |
| 14 #if defined(OS_WIN) |
| 15 #include "skia/ext/skia_utils_win.h" |
| 16 #endif |
| 17 |
15 namespace views { | 18 namespace views { |
16 | 19 |
17 // static | 20 // static |
18 const char SingleSplitView::kViewClassName[] = "SingleSplitView"; | 21 const char SingleSplitView::kViewClassName[] = "SingleSplitView"; |
19 | 22 |
20 // Size of the divider in pixels. | 23 // Size of the divider in pixels. |
21 static const int kDividerSize = 4; | 24 static const int kDividerSize = 4; |
22 | 25 |
23 SingleSplitView::SingleSplitView(View* leading, | 26 SingleSplitView::SingleSplitView(View* leading, |
24 View* trailing, | 27 View* trailing, |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 const gfx::Rect& bounds) const { | 247 const gfx::Rect& bounds) const { |
245 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); | 248 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); |
246 if (divider_offset < 0) | 249 if (divider_offset < 0) |
247 // primary_axis_size may < GetDividerSize during initial layout. | 250 // primary_axis_size may < GetDividerSize during initial layout. |
248 return std::max(0, (primary_axis_size - GetDividerSize()) / 2); | 251 return std::max(0, (primary_axis_size - GetDividerSize()) / 2); |
249 return std::min(divider_offset, | 252 return std::min(divider_offset, |
250 std::max(primary_axis_size - GetDividerSize(), 0)); | 253 std::max(primary_axis_size - GetDividerSize(), 0)); |
251 } | 254 } |
252 | 255 |
253 } // namespace views | 256 } // namespace views |
OLD | NEW |