| 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 <map> | 5 #include <map> |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "ui/base/clipboard/clipboard.h" | 9 #include "ui/base/clipboard/clipboard.h" |
| 10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 // TouchEvent | 408 // TouchEvent |
| 409 //////////////////////////////////////////////////////////////////////////////// | 409 //////////////////////////////////////////////////////////////////////////////// |
| 410 bool MockGestureManager::ProcessTouchEventForGesture( | 410 bool MockGestureManager::ProcessTouchEventForGesture( |
| 411 const TouchEvent& event, | 411 const TouchEvent& event, |
| 412 View* source, | 412 View* source, |
| 413 View::TouchStatus status) { | 413 View::TouchStatus status) { |
| 414 if (status != View::TOUCH_STATUS_UNKNOWN) { | 414 if (status != View::TOUCH_STATUS_UNKNOWN) { |
| 415 dispatched_synthetic_event_ = false; | 415 dispatched_synthetic_event_ = false; |
| 416 return false; | 416 return false; |
| 417 } | 417 } |
| 418 last_touch_event_ = event.type(); | 418 last_touch_event_ = event.GetType(); |
| 419 last_view_ = source; | 419 last_view_ = source; |
| 420 previously_handled_flag_ = status != View::TOUCH_STATUS_UNKNOWN; | 420 previously_handled_flag_ = status != View::TOUCH_STATUS_UNKNOWN; |
| 421 dispatched_synthetic_event_ = true; | 421 dispatched_synthetic_event_ = true; |
| 422 return true; | 422 return true; |
| 423 } | 423 } |
| 424 | 424 |
| 425 MockGestureManager::MockGestureManager() { | 425 MockGestureManager::MockGestureManager() { |
| 426 } | 426 } |
| 427 | 427 |
| 428 View::TouchStatus TestView::OnTouchEvent(const TouchEvent& event) { | 428 View::TouchStatus TestView::OnTouchEvent(const TouchEvent& event) { |
| 429 last_touch_event_type_ = event.type(); | 429 last_touch_event_type_ = event.GetType(); |
| 430 location_.SetPoint(event.x(), event.y()); | 430 location_.SetPoint(event.x(), event.y()); |
| 431 if (!in_touch_sequence_) { | 431 if (!in_touch_sequence_) { |
| 432 if (event.type() == ui::ET_TOUCH_PRESSED) { | 432 if (event.GetType() == ui::ET_TOUCH_PRESSED) { |
| 433 in_touch_sequence_ = true; | 433 in_touch_sequence_ = true; |
| 434 return TOUCH_STATUS_START; | 434 return TOUCH_STATUS_START; |
| 435 } | 435 } |
| 436 } else { | 436 } else { |
| 437 if (event.type() == ui::ET_TOUCH_RELEASED) { | 437 if (event.GetType() == ui::ET_TOUCH_RELEASED) { |
| 438 in_touch_sequence_ = false; | 438 in_touch_sequence_ = false; |
| 439 return TOUCH_STATUS_END; | 439 return TOUCH_STATUS_END; |
| 440 } | 440 } |
| 441 return TOUCH_STATUS_CONTINUE; | 441 return TOUCH_STATUS_CONTINUE; |
| 442 } | 442 } |
| 443 return last_touch_event_was_handled_ ? TOUCH_STATUS_CONTINUE : | 443 return last_touch_event_was_handled_ ? TOUCH_STATUS_CONTINUE : |
| 444 TOUCH_STATUS_UNKNOWN; | 444 TOUCH_STATUS_UNKNOWN; |
| 445 } | 445 } |
| 446 | 446 |
| 447 TEST_F(ViewTest, TouchEvent) { | 447 TEST_F(ViewTest, TouchEvent) { |
| (...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1507 #endif | 1507 #endif |
| 1508 } | 1508 } |
| 1509 | 1509 |
| 1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { | 1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { |
| 1511 // TODO(georgey): Fix the test for Linux | 1511 // TODO(georgey): Fix the test for Linux |
| 1512 #if defined(OS_WIN) | 1512 #if defined(OS_WIN) |
| 1513 TestChangeNativeViewHierarchy test(this); | 1513 TestChangeNativeViewHierarchy test(this); |
| 1514 test.CheckChangingHierarhy(); | 1514 test.CheckChangingHierarhy(); |
| 1515 #endif | 1515 #endif |
| 1516 } | 1516 } |
| OLD | NEW |