Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Side by Side Diff: ui/views/view.cc

Issue 10939006: Make cursors work on win aura. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 years, 3 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/base/cursor/cursor_loader_win.cc ('k') | ui/views/views.gyp » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/view.h" 5 #include "ui/views/view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 747 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 758
759 gfx::Point point_in_child_coords(point); 759 gfx::Point point_in_child_coords(point);
760 ConvertPointToTarget(this, child, &point_in_child_coords); 760 ConvertPointToTarget(this, child, &point_in_child_coords);
761 if (child->HitTestPoint(point_in_child_coords)) 761 if (child->HitTestPoint(point_in_child_coords))
762 return child->GetEventHandlerForPoint(point_in_child_coords); 762 return child->GetEventHandlerForPoint(point_in_child_coords);
763 } 763 }
764 return this; 764 return this;
765 } 765 }
766 766
767 gfx::NativeCursor View::GetCursor(const ui::MouseEvent& event) { 767 gfx::NativeCursor View::GetCursor(const ui::MouseEvent& event) {
768 #if defined(OS_WIN) && !defined(USE_AURA) 768 #if defined(OS_WIN)
769 #if defined(USE_AURA)
770 static ui::Cursor arrow;
771 if (!arrow.platform())
772 arrow.SetPlatformCursor(LoadCursor(NULL, IDC_ARROW));
773 return arrow;
774 #else
769 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW); 775 static HCURSOR arrow = LoadCursor(NULL, IDC_ARROW);
770 return arrow; 776 return arrow;
777 #endif
771 #else 778 #else
772 return gfx::kNullCursor; 779 return gfx::kNullCursor;
773 #endif 780 #endif
774 } 781 }
775 782
776 bool View::HitTestPoint(const gfx::Point& point) const { 783 bool View::HitTestPoint(const gfx::Point& point) const {
777 return HitTestRect(gfx::Rect(point, gfx::Size(1, 1))); 784 return HitTestRect(gfx::Rect(point, gfx::Size(1, 1)));
778 } 785 }
779 786
780 bool View::HitTestRect(const gfx::Rect& rect) const { 787 bool View::HitTestRect(const gfx::Rect& rect) const {
(...skipping 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 gfx::Point widget_location(event.location()); 2120 gfx::Point widget_location(event.location());
2114 ConvertPointToWidget(this, &widget_location); 2121 ConvertPointToWidget(this, &widget_location);
2115 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations); 2122 GetWidget()->RunShellDrag(this, data, widget_location, drag_operations);
2116 return true; 2123 return true;
2117 #else 2124 #else
2118 return false; 2125 return false;
2119 #endif // !defined(OS_MACOSX) 2126 #endif // !defined(OS_MACOSX)
2120 } 2127 }
2121 2128
2122 } // namespace views 2129 } // namespace views
OLDNEW
« no previous file with comments | « ui/base/cursor/cursor_loader_win.cc ('k') | ui/views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698