| 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/resize_area.h" | 5 #include "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 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 std::string ResizeArea::GetClassName() const { | 30 std::string ResizeArea::GetClassName() const { |
| 31 return kViewClassName; | 31 return kViewClassName; |
| 32 } | 32 } |
| 33 | 33 |
| 34 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { | 34 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { |
| 35 if (!IsEnabled()) | 35 if (!IsEnabled()) |
| 36 return NULL; | 36 return NULL; |
| 37 #if defined(OS_WIN) | 37 #if defined(OS_WIN) |
| 38 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); | 38 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); |
| 39 return g_resize_cursor; | 39 return g_resize_cursor; |
| 40 #elif defined(USE_AURA) |
| 41 // TODO(saintlou): |
| 42 return NULL; |
| 40 #elif defined(OS_LINUX) | 43 #elif defined(OS_LINUX) |
| 41 return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW); | 44 return gfx::GetCursor(GDK_SB_H_DOUBLE_ARROW); |
| 42 #endif | 45 #endif |
| 43 } | 46 } |
| 44 | 47 |
| 45 bool ResizeArea::OnMousePressed(const views::MouseEvent& event) { | 48 bool ResizeArea::OnMousePressed(const views::MouseEvent& event) { |
| 46 if (!event.IsOnlyLeftMouseButton()) | 49 if (!event.IsOnlyLeftMouseButton()) |
| 47 return false; | 50 return false; |
| 48 | 51 |
| 49 // The resize area obviously will move once you start dragging so we need to | 52 // The resize area obviously will move once you start dragging so we need to |
| (...skipping 28 matching lines...) Expand all Loading... |
| 78 | 81 |
| 79 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) { | 82 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) { |
| 80 gfx::Point point(resize_amount, 0); | 83 gfx::Point point(resize_amount, 0); |
| 81 View::ConvertPointToScreen(this, &point); | 84 View::ConvertPointToScreen(this, &point); |
| 82 resize_amount = point.x() - initial_position_; | 85 resize_amount = point.x() - initial_position_; |
| 83 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount, | 86 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount, |
| 84 last_update); | 87 last_update); |
| 85 } | 88 } |
| 86 | 89 |
| 87 } // namespace views | 90 } // namespace views |
| OLD | NEW |