OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/view.h" | 5 #include "views/view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #ifndef NDEBUG | 8 #ifndef NDEBUG |
9 #include <iostream> | 9 #include <iostream> |
10 #endif | 10 #endif |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "views/widget/root_view.h" | 22 #include "views/widget/root_view.h" |
23 #include "views/widget/tooltip_manager.h" | 23 #include "views/widget/tooltip_manager.h" |
24 #include "views/widget/widget.h" | 24 #include "views/widget/widget.h" |
25 #include "views/window/window.h" | 25 #include "views/window/window.h" |
26 | 26 |
27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
28 #include "base/win/scoped_gdi_object.h" | 28 #include "base/win/scoped_gdi_object.h" |
29 #include "views/accessibility/view_accessibility.h" | 29 #include "views/accessibility/view_accessibility.h" |
30 #endif | 30 #endif |
31 #if defined(OS_LINUX) | 31 #if defined(OS_LINUX) |
32 #include "app/scoped_handle_gtk.h" | 32 #include "ui/base/gtk/scoped_handle_gtk.h" |
33 #endif | 33 #endif |
34 | 34 |
35 namespace views { | 35 namespace views { |
36 | 36 |
37 // static | 37 // static |
38 ViewsDelegate* ViewsDelegate::views_delegate = NULL; | 38 ViewsDelegate* ViewsDelegate::views_delegate = NULL; |
39 | 39 |
40 // static | 40 // static |
41 char View::kViewClassName[] = "views/View"; | 41 char View::kViewClassName[] = "views/View"; |
42 | 42 |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 bool View::HitTest(const gfx::Point& l) const { | 448 bool View::HitTest(const gfx::Point& l) const { |
449 if (l.x() >= 0 && l.x() < width() && l.y() >= 0 && l.y() < height()) { | 449 if (l.x() >= 0 && l.x() < width() && l.y() >= 0 && l.y() < height()) { |
450 if (HasHitTestMask()) { | 450 if (HasHitTestMask()) { |
451 gfx::Path mask; | 451 gfx::Path mask; |
452 GetHitTestMask(&mask); | 452 GetHitTestMask(&mask); |
453 // TODO: can this use SkRegion's contains instead? | 453 // TODO: can this use SkRegion's contains instead? |
454 #if defined(OS_WIN) | 454 #if defined(OS_WIN) |
455 base::win::ScopedRegion rgn(mask.CreateNativeRegion()); | 455 base::win::ScopedRegion rgn(mask.CreateNativeRegion()); |
456 return !!PtInRegion(rgn, l.x(), l.y()); | 456 return !!PtInRegion(rgn, l.x(), l.y()); |
457 #elif defined(TOOLKIT_USES_GTK) | 457 #elif defined(TOOLKIT_USES_GTK) |
458 ScopedRegion rgn(mask.CreateNativeRegion()); | 458 ui::ScopedRegion rgn(mask.CreateNativeRegion()); |
459 return gdk_region_point_in(rgn.Get(), l.x(), l.y()); | 459 return gdk_region_point_in(rgn.Get(), l.x(), l.y()); |
460 #endif | 460 #endif |
461 } | 461 } |
462 // No mask, but inside our bounds. | 462 // No mask, but inside our bounds. |
463 return true; | 463 return true; |
464 } | 464 } |
465 // Outside our bounds. | 465 // Outside our bounds. |
466 return false; | 466 return false; |
467 } | 467 } |
468 | 468 |
(...skipping 1061 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1530 possible_drag = false; | 1530 possible_drag = false; |
1531 start_pt = gfx::Point(); | 1531 start_pt = gfx::Point(); |
1532 } | 1532 } |
1533 | 1533 |
1534 void View::DragInfo::PossibleDrag(const gfx::Point& p) { | 1534 void View::DragInfo::PossibleDrag(const gfx::Point& p) { |
1535 possible_drag = true; | 1535 possible_drag = true; |
1536 start_pt = p; | 1536 start_pt = p; |
1537 } | 1537 } |
1538 | 1538 |
1539 } // namespace | 1539 } // namespace |
OLD | NEW |