| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 return gfx::Size(width, height); | 93 return gfx::Size(width, height); |
| 94 } | 94 } |
| 95 | 95 |
| 96 gfx::NativeCursor SingleSplitView::GetCursor(const MouseEvent& event) { | 96 gfx::NativeCursor SingleSplitView::GetCursor(const MouseEvent& event) { |
| 97 if (!IsPointInDivider(event.location())) | 97 if (!IsPointInDivider(event.location())) |
| 98 return NULL; | 98 return NULL; |
| 99 #if defined(OS_WIN) | 99 #if defined(OS_WIN) |
| 100 static HCURSOR we_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); | 100 static HCURSOR we_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); |
| 101 static HCURSOR ns_resize_cursor = LoadCursor(NULL, IDC_SIZENS); | 101 static HCURSOR ns_resize_cursor = LoadCursor(NULL, IDC_SIZENS); |
| 102 return is_horizontal_ ? we_resize_cursor : ns_resize_cursor; | 102 return is_horizontal_ ? we_resize_cursor : ns_resize_cursor; |
| 103 #elif defined(USE_AURA) |
| 104 // TODO(saintlou): |
| 105 return NULL; |
| 103 #elif defined(OS_LINUX) | 106 #elif defined(OS_LINUX) |
| 104 return gfx::GetCursor(is_horizontal_ ? GDK_SB_H_DOUBLE_ARROW : | 107 return gfx::GetCursor(is_horizontal_ ? GDK_SB_H_DOUBLE_ARROW : |
| 105 GDK_SB_V_DOUBLE_ARROW); | 108 GDK_SB_V_DOUBLE_ARROW); |
| 106 #endif | 109 #endif |
| 107 } | 110 } |
| 108 | 111 |
| 109 void SingleSplitView::CalculateChildrenBounds( | 112 void SingleSplitView::CalculateChildrenBounds( |
| 110 const gfx::Rect& bounds, | 113 const gfx::Rect& bounds, |
| 111 gfx::Rect* leading_bounds, | 114 gfx::Rect* leading_bounds, |
| 112 gfx::Rect* trailing_bounds) const { | 115 gfx::Rect* trailing_bounds) const { |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 const gfx::Rect& bounds) const { | 249 const gfx::Rect& bounds) const { |
| 247 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); | 250 int primary_axis_size = GetPrimaryAxisSize(bounds.width(), bounds.height()); |
| 248 if (divider_offset < 0) | 251 if (divider_offset < 0) |
| 249 // primary_axis_size may < kDividerSize during initial layout. | 252 // primary_axis_size may < kDividerSize during initial layout. |
| 250 return std::max(0, (primary_axis_size - kDividerSize) / 2); | 253 return std::max(0, (primary_axis_size - kDividerSize) / 2); |
| 251 return std::min(divider_offset, | 254 return std::min(divider_offset, |
| 252 std::max(primary_axis_size - kDividerSize, 0)); | 255 std::max(primary_axis_size - kDividerSize, 0)); |
| 253 } | 256 } |
| 254 | 257 |
| 255 } // namespace views | 258 } // namespace views |
| OLD | NEW |