Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: ui/views/controls/resize_area.cc

Issue 9463003: aura-x11: Add custom web cursor support. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/link.cc ('k') | ui/views/controls/single_split_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 11
12 #if defined(USE_AURA) 12 #if defined(USE_AURA)
13 #include "ui/aura/cursor.h" 13 #include "ui/base/cursor/cursor.h"
14 #endif 14 #endif
15 15
16 namespace views { 16 namespace views {
17 17
18 const char ResizeArea::kViewClassName[] = "views/ResizeArea"; 18 const char ResizeArea::kViewClassName[] = "views/ResizeArea";
19 19
20 //////////////////////////////////////////////////////////////////////////////// 20 ////////////////////////////////////////////////////////////////////////////////
21 // ResizeArea 21 // ResizeArea
22 22
23 ResizeArea::ResizeArea(ResizeAreaDelegate* delegate) 23 ResizeArea::ResizeArea(ResizeAreaDelegate* delegate)
24 : delegate_(delegate), 24 : delegate_(delegate),
25 initial_position_(0) { 25 initial_position_(0) {
26 } 26 }
27 27
28 ResizeArea::~ResizeArea() { 28 ResizeArea::~ResizeArea() {
29 } 29 }
30 30
31 std::string ResizeArea::GetClassName() const { 31 std::string ResizeArea::GetClassName() const {
32 return kViewClassName; 32 return kViewClassName;
33 } 33 }
34 34
35 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) { 35 gfx::NativeCursor ResizeArea::GetCursor(const MouseEvent& event) {
36 if (!enabled()) 36 if (!enabled())
37 return gfx::kNullCursor; 37 return gfx::kNullCursor;
38 #if defined(USE_AURA) 38 #if defined(USE_AURA)
39 return aura::kCursorEastWestResize; 39 return ui::kCursorEastWestResize;
40 #elif defined(OS_WIN) 40 #elif defined(OS_WIN)
41 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE); 41 static HCURSOR g_resize_cursor = LoadCursor(NULL, IDC_SIZEWE);
42 return g_resize_cursor; 42 return g_resize_cursor;
43 #endif 43 #endif
44 } 44 }
45 45
46 bool ResizeArea::OnMousePressed(const views::MouseEvent& event) { 46 bool ResizeArea::OnMousePressed(const views::MouseEvent& event) {
47 if (!event.IsOnlyLeftMouseButton()) 47 if (!event.IsOnlyLeftMouseButton())
48 return false; 48 return false;
49 49
(...skipping 29 matching lines...) Expand all
79 79
80 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) { 80 void ResizeArea::ReportResizeAmount(int resize_amount, bool last_update) {
81 gfx::Point point(resize_amount, 0); 81 gfx::Point point(resize_amount, 0);
82 View::ConvertPointToScreen(this, &point); 82 View::ConvertPointToScreen(this, &point);
83 resize_amount = point.x() - initial_position_; 83 resize_amount = point.x() - initial_position_;
84 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount, 84 delegate_->OnResize(base::i18n::IsRTL() ? -resize_amount : resize_amount,
85 last_update); 85 last_update);
86 } 86 }
87 87
88 } // namespace views 88 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/link.cc ('k') | ui/views/controls/single_split_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698