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

Side by Side Diff: views/view.cc

Issue 6347002: touch: Return an enum from OnTouchEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 9 years, 11 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 | « views/view.h ('k') | views/view_unittest.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) 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
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 return OnTouchEvent(e);
547 return result;
548 } 547 }
549 #endif 548 #endif
550 549
551 void View::AddChildView(View* v) { 550 void View::AddChildView(View* v) {
552 AddChildView(static_cast<int>(child_views_.size()), v); 551 AddChildView(static_cast<int>(child_views_.size()), v);
553 } 552 }
554 553
555 void View::AddChildView(int index, View* v) { 554 void View::AddChildView(int index, View* v) {
556 CHECK(v != this) << "You cannot add a view as its own child"; 555 CHECK(v != this) << "You cannot add a view as its own child";
557 556
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
1287 void View::OnMouseMoved(const MouseEvent& e) { 1286 void View::OnMouseMoved(const MouseEvent& e) {
1288 } 1287 }
1289 1288
1290 void View::OnMouseEntered(const MouseEvent& e) { 1289 void View::OnMouseEntered(const MouseEvent& e) {
1291 } 1290 }
1292 1291
1293 void View::OnMouseExited(const MouseEvent& e) { 1292 void View::OnMouseExited(const MouseEvent& e) {
1294 } 1293 }
1295 1294
1296 #if defined(TOUCH_UI) 1295 #if defined(TOUCH_UI)
1297 bool View::OnTouchEvent(const TouchEvent& event) { 1296 View::TouchStatus View::OnTouchEvent(const TouchEvent& event) {
1298 DVLOG(1) << "visited the OnTouchEvent"; 1297 DVLOG(1) << "visited the OnTouchEvent";
1299 return false; 1298 return TOUCH_STATUS_UNKNOWN;
1300 } 1299 }
1301 #endif 1300 #endif
1302 1301
1303 void View::SetMouseHandler(View *new_mouse_handler) { 1302 void View::SetMouseHandler(View *new_mouse_handler) {
1304 // It is valid for new_mouse_handler to be NULL 1303 // It is valid for new_mouse_handler to be NULL
1305 if (parent_) 1304 if (parent_)
1306 parent_->SetMouseHandler(new_mouse_handler); 1305 parent_->SetMouseHandler(new_mouse_handler);
1307 } 1306 }
1308 1307
1309 void View::SetVisible(bool flag) { 1308 void View::SetVisible(bool flag) {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
1531 possible_drag = false; 1530 possible_drag = false;
1532 start_pt = gfx::Point(); 1531 start_pt = gfx::Point();
1533 } 1532 }
1534 1533
1535 void View::DragInfo::PossibleDrag(const gfx::Point& p) { 1534 void View::DragInfo::PossibleDrag(const gfx::Point& p) {
1536 possible_drag = true; 1535 possible_drag = true;
1537 start_pt = p; 1536 start_pt = p;
1538 } 1537 }
1539 1538
1540 } // namespace 1539 } // namespace
OLDNEW
« no previous file with comments | « views/view.h ('k') | views/view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698