OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/views/single_split_view.h" | 5 #include "chrome/views/single_split_view.h" |
6 | 6 |
7 #include "base/gfx/skia_utils.h" | |
8 #include "chrome/common/gfx/chrome_canvas.h" | 7 #include "chrome/common/gfx/chrome_canvas.h" |
9 #include "chrome/views/background.h" | 8 #include "chrome/views/background.h" |
| 9 #include "skia/ext/skia_utils_win.h" |
10 | 10 |
11 namespace views { | 11 namespace views { |
12 | 12 |
13 // Size of the divider in pixels. | 13 // Size of the divider in pixels. |
14 static const int kDividerSize = 4; | 14 static const int kDividerSize = 4; |
15 | 15 |
16 SingleSplitView::SingleSplitView(View* leading, View* trailing) | 16 SingleSplitView::SingleSplitView(View* leading, View* trailing) |
17 : divider_x_(-1) { | 17 : divider_x_(-1) { |
18 AddChildView(leading); | 18 AddChildView(leading); |
19 AddChildView(trailing); | 19 AddChildView(trailing); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 bool SingleSplitView::IsPointInDivider(int x) { | 107 bool SingleSplitView::IsPointInDivider(int x) { |
108 if (GetChildViewCount() < 2) | 108 if (GetChildViewCount() < 2) |
109 return false; | 109 return false; |
110 | 110 |
111 int divider_relative_x = | 111 int divider_relative_x = |
112 x - GetChildViewAt(UILayoutIsRightToLeft() ? 1 : 0)->width(); | 112 x - GetChildViewAt(UILayoutIsRightToLeft() ? 1 : 0)->width(); |
113 return (divider_relative_x >= 0 && divider_relative_x < kDividerSize); | 113 return (divider_relative_x >= 0 && divider_relative_x < kDividerSize); |
114 } | 114 } |
115 | 115 |
116 } // namespace views | 116 } // namespace views |
OLD | NEW |