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 "ui/views/controls/resize_area.h" | 5 #include "ui/views/controls/resize_area.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/base/resource/resource_bundle.h" | 9 #include "ui/base/resource/resource_bundle.h" |
10 #include "ui/views/controls/resize_area_delegate.h" | 10 #include "ui/views/controls/resize_area_delegate.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 ResizeArea::~ResizeArea() { | 32 ResizeArea::~ResizeArea() { |
33 } | 33 } |
34 | 34 |
35 std::string ResizeArea::GetClassName() const { | 35 std::string ResizeArea::GetClassName() const { |
36 return kViewClassName; | 36 return kViewClassName; |
37 } | 37 } |
38 | 38 |
39 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { | 39 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { |
40 if (!IsEnabled()) | 40 if (!enabled()) |
41 return gfx::kNullCursor; | 41 return gfx::kNullCursor; |
42 #if defined(USE_AURA) | 42 #if defined(USE_AURA) |
43 return aura::kCursorEastWestResize; | 43 return aura::kCursorEastWestResize; |
44 #elif defined(OS_WIN) | 44 #elif defined(OS_WIN) |
45 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); | 45 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); |
46 return g_resize_cursor; | 46 return g_resize_cursor; |
47 #elif defined(OS_LINUX) | 47 #elif defined(OS_LINUX) |
48 return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW); | 48 return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW); |
49 #endif | 49 #endif |
50 } | 50 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 85 |
86 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) { | 86 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) { |
87 gfx::Point point(resize_amount, 0); | 87 gfx::Point point(resize_amount, 0); |
88 View::ConvertPointToScreen(this, &point); | 88 View::ConvertPointToScreen(this, &point); |
89 resize_amount = point.x() - initial_position_; | 89 resize_amount = point.x() - initial_position_; |
90 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount, | 90 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount, |
91 last_update); | 91 last_update); |
92 } | 92 } |
93 | 93 |
94 } // namespace views | 94 } // namespace views |
OLD | NEW |