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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 ConvertPointToScreen(this, &location); | 533 ConvertPointToScreen(this, &location); |
534 ShowContextMenu(location, true); | 534 ShowContextMenu(location, true); |
535 } | 535 } |
536 } else { | 536 } else { |
537 OnMouseReleased(e, canceled); | 537 OnMouseReleased(e, canceled); |
538 } | 538 } |
539 // WARNING: we may have been deleted. | 539 // WARNING: we may have been deleted. |
540 } | 540 } |
541 | 541 |
542 #if defined(TOUCH_UI) | 542 #if defined(TOUCH_UI) |
543 bool View::ProcessTouchEvent(const TouchEvent& e) { | 543 View::TouchStatus View::ProcessTouchEvent(const TouchEvent& e) { |
544 // TODO(rjkroege): Implement a grab scheme similar to as | 544 // TODO(rjkroege): Implement a grab scheme similar to as |
545 // as is found in MousePressed. | 545 // as is found in MousePressed. |
546 const bool result = OnTouchEvent(e); | 546 const TouchStatus status = OnTouchEvent(e); |
547 return result; | 547 return status; |
548 } | 548 } |
549 #endif | 549 #endif |
550 | 550 |
551 void View::AddChildView(View* v) { | 551 void View::AddChildView(View* v) { |
552 AddChildView(static_cast<int>(child_views_.size()), v); | 552 AddChildView(static_cast<int>(child_views_.size()), v); |
553 } | 553 } |
554 | 554 |
555 void View::AddChildView(int index, View* v) { | 555 void View::AddChildView(int index, View* v) { |
556 CHECK(v != this) << "You cannot add a view as its own child"; | 556 CHECK(v != this) << "You cannot add a view as its own child"; |
557 | 557 |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 void View::OnMouseMoved(const MouseEvent& e) { | 1287 void View::OnMouseMoved(const MouseEvent& e) { |
1288 } | 1288 } |
1289 | 1289 |
1290 void View::OnMouseEntered(const MouseEvent& e) { | 1290 void View::OnMouseEntered(const MouseEvent& e) { |
1291 } | 1291 } |
1292 | 1292 |
1293 void View::OnMouseExited(const MouseEvent& e) { | 1293 void View::OnMouseExited(const MouseEvent& e) { |
1294 } | 1294 } |
1295 | 1295 |
1296 #if defined(TOUCH_UI) | 1296 #if defined(TOUCH_UI) |
1297 bool View::OnTouchEvent(const TouchEvent& event) { | 1297 View::TouchStatus View::OnTouchEvent(const TouchEvent& event) { |
1298 DVLOG(1) << "visited the OnTouchEvent"; | 1298 DVLOG(1) << "visited the OnTouchEvent"; |
1299 return false; | 1299 return TOUCH_STATUS_UNKNOWN; |
1300 } | 1300 } |
1301 #endif | 1301 #endif |
1302 | 1302 |
1303 void View::SetMouseHandler(View *new_mouse_handler) { | 1303 void View::SetMouseHandler(View *new_mouse_handler) { |
1304 // It is valid for new_mouse_handler to be NULL | 1304 // It is valid for new_mouse_handler to be NULL |
1305 if (parent_) | 1305 if (parent_) |
1306 parent_->SetMouseHandler(new_mouse_handler); | 1306 parent_->SetMouseHandler(new_mouse_handler); |
1307 } | 1307 } |
1308 | 1308 |
1309 void View::SetVisible(bool flag) { | 1309 void View::SetVisible(bool flag) { |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1531 possible_drag = false; | 1531 possible_drag = false; |
1532 start_pt = gfx::Point(); | 1532 start_pt = gfx::Point(); |
1533 } | 1533 } |
1534 | 1534 |
1535 void View::DragInfo::PossibleDrag(const gfx::Point& p) { | 1535 void View::DragInfo::PossibleDrag(const gfx::Point& p) { |
1536 possible_drag = true; | 1536 possible_drag = true; |
1537 start_pt = p; | 1537 start_pt = p; |
1538 } | 1538 } |
1539 | 1539 |
1540 } // namespace | 1540 } // namespace |
OLD | NEW |