| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 426 |
| 427 bool View::HitTest(const gfx::Point& l) const { | 427 bool View::HitTest(const gfx::Point& l) const { |
| 428 if (l.x() >= 0 && l.x() < width() && l.y() >= 0 && l.y() < height()) { | 428 if (l.x() >= 0 && l.x() < width() && l.y() >= 0 && l.y() < height()) { |
| 429 if (HasHitTestMask()) { | 429 if (HasHitTestMask()) { |
| 430 gfx::Path mask; | 430 gfx::Path mask; |
| 431 GetHitTestMask(&mask); | 431 GetHitTestMask(&mask); |
| 432 ScopedRegion rgn(mask.CreateNativeRegion()); | 432 ScopedRegion rgn(mask.CreateNativeRegion()); |
| 433 // TODO: can this use SkRegion's contains instead? | 433 // TODO: can this use SkRegion's contains instead? |
| 434 #if defined(OS_WIN) | 434 #if defined(OS_WIN) |
| 435 return !!PtInRegion(rgn, l.x(), l.y()); | 435 return !!PtInRegion(rgn, l.x(), l.y()); |
| 436 #elif defined(OS_LINUX) | 436 #elif defined(TOOLKIT_USES_GTK) |
| 437 return gdk_region_point_in(rgn.Get(), l.x(), l.y()); | 437 return gdk_region_point_in(rgn.Get(), l.x(), l.y()); |
| 438 #endif | 438 #endif |
| 439 } | 439 } |
| 440 // No mask, but inside our bounds. | 440 // No mask, but inside our bounds. |
| 441 return true; | 441 return true; |
| 442 } | 442 } |
| 443 // Outside our bounds. | 443 // Outside our bounds. |
| 444 return false; | 444 return false; |
| 445 } | 445 } |
| 446 | 446 |
| (...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 start_x = start_y = 0; | 1418 start_x = start_y = 0; |
| 1419 } | 1419 } |
| 1420 | 1420 |
| 1421 void View::DragInfo::PossibleDrag(int x, int y) { | 1421 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1422 possible_drag = true; | 1422 possible_drag = true; |
| 1423 start_x = x; | 1423 start_x = x; |
| 1424 start_y = y; | 1424 start_y = y; |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 } // namespace | 1427 } // namespace |
| OLD | NEW |