Commit a6d36373 authored by Aldo Culquicondor's avatar Aldo Culquicondor Committed by Commit Bot

VR: Renaming OnMove to OnHoverMove

Bug: 846478
Cq-Include-Trybots: luci.chromium.try:android_optional_gpu_tests_rel;luci.chromium.try:linux_optional_gpu_tests_rel;luci.chromium.try:mac_optional_gpu_tests_rel;luci.chromium.try:win_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_vr
Change-Id: Id24c9d4e9123b888a2228cdf0043e51e2850e97b
Reviewed-on: https://chromium-review.googlesource.com/1073189Reviewed-by: default avatarBiao She <bshe@chromium.org>
Commit-Queue: Aldo Culquicondor <acondor@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561874}
parent 2e7257da
......@@ -77,11 +77,11 @@ void Keyboard::OnHoverLeave() {
delegate_->OnHoverLeave();
}
void Keyboard::OnMove(const gfx::PointF& position) {
void Keyboard::OnHoverMove(const gfx::PointF& position) {
if (!delegate_)
return;
delegate_->OnMove(position);
delegate_->OnHoverMove(position);
}
void Keyboard::OnButtonDown(const gfx::PointF& position) {
......
......@@ -32,7 +32,7 @@ class Keyboard : public UiElement {
void OnHoverEnter(const gfx::PointF& position) override;
void OnHoverLeave() override;
void OnMove(const gfx::PointF& position) override;
void OnHoverMove(const gfx::PointF& position) override;
void OnButtonDown(const gfx::PointF& position) override;
void OnButtonUp(const gfx::PointF& position) override;
......
......@@ -36,9 +36,9 @@ void PlatformUiElement::OnHoverLeave() {
delegate_->OnHoverLeave();
}
void PlatformUiElement::OnMove(const gfx::PointF& position) {
void PlatformUiElement::OnHoverMove(const gfx::PointF& position) {
if (delegate_)
delegate_->OnMove(position);
delegate_->OnHoverMove(position);
}
void PlatformUiElement::OnButtonDown(const gfx::PointF& position) {
......
......@@ -24,7 +24,7 @@ class PlatformUiElement : public UiElement {
void OnHoverEnter(const gfx::PointF& position) override;
void OnHoverLeave() override;
void OnMove(const gfx::PointF& position) override;
void OnHoverMove(const gfx::PointF& position) override;
void OnButtonDown(const gfx::PointF& position) override;
void OnButtonUp(const gfx::PointF& position) override;
void OnFlingCancel(std::unique_ptr<blink::WebGestureEvent> gesture,
......
......@@ -162,13 +162,13 @@ TEST(TextInputTest, ControllerInteractionsSentToDelegate) {
EXPECT_CALL(*kb_delegate, OnHoverEnter(_)).InSequence(s);
EXPECT_CALL(*kb_delegate, OnHoverLeave()).InSequence(s);
EXPECT_CALL(*kb_delegate, OnMove(_)).InSequence(s);
EXPECT_CALL(*kb_delegate, OnHoverMove(_)).InSequence(s);
EXPECT_CALL(*kb_delegate, OnButtonDown(_)).InSequence(s);
EXPECT_CALL(*kb_delegate, OnButtonUp(_)).InSequence(s);
gfx::PointF p;
keyboard->OnHoverEnter(p);
keyboard->OnHoverLeave();
keyboard->OnMove(p);
keyboard->OnHoverMove(p);
keyboard->OnButtonDown(p);
keyboard->OnButtonUp(p);
}
......
......@@ -176,14 +176,14 @@ void UiElement::OnHoverLeave() {
}
}
void UiElement::OnMove(const gfx::PointF& position) {
if (GetSounds().move != kSoundNone && audio_delegate_) {
audio_delegate_->PlaySound(GetSounds().move);
void UiElement::OnHoverMove(const gfx::PointF& position) {
if (GetSounds().hover_move != kSoundNone && audio_delegate_) {
audio_delegate_->PlaySound(GetSounds().hover_move);
}
if (event_handlers_.hover_move) {
event_handlers_.hover_move.Run(position);
} else if (parent() && bubble_events()) {
parent()->OnMove(position);
parent()->OnHoverMove(position);
}
}
......
......@@ -149,7 +149,7 @@ class UiElement : public cc::AnimationTarget {
// Controller interaction methods.
virtual void OnHoverEnter(const gfx::PointF& position);
virtual void OnHoverLeave();
virtual void OnMove(const gfx::PointF& position);
virtual void OnHoverMove(const gfx::PointF& position);
virtual void OnButtonDown(const gfx::PointF& position);
virtual void OnButtonUp(const gfx::PointF& position);
virtual void OnFlingCancel(std::unique_ptr<blink::WebGestureEvent> gesture,
......
......@@ -499,7 +499,7 @@ TEST(UiElement, EventBubbling) {
// Events on grand_child don't bubble up the parent chain.
grand_child_ptr->OnHoverEnter(gfx::PointF());
grand_child_ptr->OnMove(gfx::PointF());
grand_child_ptr->OnHoverMove(gfx::PointF());
grand_child_ptr->OnHoverLeave();
grand_child_ptr->OnButtonDown(gfx::PointF());
grand_child_ptr->OnButtonUp(gfx::PointF());
......@@ -509,7 +509,7 @@ TEST(UiElement, EventBubbling) {
// Events on grand_child bubble up the parent chain.
grand_child_ptr->set_bubble_events(true);
grand_child_ptr->OnHoverEnter(gfx::PointF());
grand_child_ptr->OnMove(gfx::PointF());
grand_child_ptr->OnHoverMove(gfx::PointF());
grand_child_ptr->OnHoverLeave();
grand_child_ptr->OnButtonDown(gfx::PointF());
grand_child_ptr->OnButtonUp(gfx::PointF());
......
......@@ -35,7 +35,7 @@ class KeyboardDelegate {
const gfx::PointF& touch_position) {}
virtual void OnHoverEnter(const gfx::PointF& position) {}
virtual void OnHoverLeave() {}
virtual void OnMove(const gfx::PointF& position) {}
virtual void OnHoverMove(const gfx::PointF& position) {}
virtual void OnButtonDown(const gfx::PointF& position) {}
virtual void OnButtonUp(const gfx::PointF& position) {}
};
......
......@@ -14,7 +14,7 @@ struct Sounds {
SoundId hover_leave = kSoundNone;
SoundId button_down = kSoundNone;
SoundId button_up = kSoundNone;
SoundId move = kSoundNone;
SoundId hover_move = kSoundNone;
};
} // namespace vr
......
......@@ -43,7 +43,8 @@ void PlatformUiInputDelegate::OnHoverLeave() {
MakeMouseEvent(blink::WebInputEvent::kMouseLeave, kOutOfBoundsPoint));
}
void PlatformUiInputDelegate::OnMove(const gfx::PointF& normalized_hit_point) {
void PlatformUiInputDelegate::OnHoverMove(
const gfx::PointF& normalized_hit_point) {
SendGestureToTarget(
MakeMouseEvent(blink::WebInputEvent::kMouseMove, normalized_hit_point));
}
......
......@@ -44,7 +44,7 @@ class PlatformUiInputDelegate {
// MockContentInputDelegate.
VIRTUAL_FOR_MOCKS void OnHoverEnter(const gfx::PointF& normalized_hit_point);
VIRTUAL_FOR_MOCKS void OnHoverLeave();
VIRTUAL_FOR_MOCKS void OnMove(const gfx::PointF& normalized_hit_point);
VIRTUAL_FOR_MOCKS void OnHoverMove(const gfx::PointF& normalized_hit_point);
VIRTUAL_FOR_MOCKS void OnButtonDown(const gfx::PointF& normalized_hit_point);
VIRTUAL_FOR_MOCKS void OnButtonUp(const gfx::PointF& normalized_hit_point);
VIRTUAL_FOR_MOCKS void OnFlingCancel(
......
......@@ -19,7 +19,7 @@ class MockContentInputDelegate : public ContentInputDelegate {
MOCK_METHOD1(OnHoverEnter, void(const gfx::PointF& normalized_hit_point));
MOCK_METHOD0(OnHoverLeave, void());
MOCK_METHOD1(OnMove, void(const gfx::PointF& normalized_hit_point));
MOCK_METHOD1(OnHoverMove, void(const gfx::PointF& normalized_hit_point));
MOCK_METHOD1(OnButtonDown, void(const gfx::PointF& normalized_hit_point));
MOCK_METHOD1(OnButtonUp, void(const gfx::PointF& normalized_hit_point));
......
......@@ -29,7 +29,7 @@ class MockKeyboardDelegate : public KeyboardDelegate {
MOCK_METHOD0(SupportsSelection, bool());
MOCK_METHOD1(OnHoverEnter, void(const gfx::PointF&));
MOCK_METHOD0(OnHoverLeave, void());
MOCK_METHOD1(OnMove, void(const gfx::PointF&));
MOCK_METHOD1(OnHoverMove, void(const gfx::PointF&));
MOCK_METHOD1(OnButtonDown, void(const gfx::PointF&));
MOCK_METHOD1(OnButtonUp, void(const gfx::PointF&));
......
......@@ -574,7 +574,7 @@ void Ui::PerformUiActionForTesting(UiTestInput test_input) {
element->OnHoverLeave();
break;
case VrUiTestAction::kMove:
element->OnMove(test_input.position);
element->OnHoverMove(test_input.position);
break;
case VrUiTestAction::kButtonDown:
element->OnButtonDown(test_input.position);
......
......@@ -279,7 +279,7 @@ void UiInputManager::SendMove(UiElement* element,
if (element->name() == kContentQuad && in_click_) {
return;
}
element->OnMove(target_point);
element->OnHoverMove(target_point);
}
void UiInputManager::SendButtonDown(UiElement* target,
......
......@@ -47,7 +47,7 @@ class MockRect : public Rect {
MOCK_METHOD1(OnHoverEnter, void(const gfx::PointF& position));
MOCK_METHOD0(OnHoverLeave, void());
MOCK_METHOD1(OnMove, void(const gfx::PointF& position));
MOCK_METHOD1(OnHoverMove, void(const gfx::PointF& position));
MOCK_METHOD1(OnButtonDown, void(const gfx::PointF& position));
MOCK_METHOD1(OnButtonUp, void(const gfx::PointF& position));
MOCK_METHOD2(OnScrollBegin,
......@@ -220,7 +220,7 @@ TEST_F(UiInputManagerTest, FocusableChildStealsFocus) {
EXPECT_CALL(*p_child, OnHoverEnter(_)).InSequence(s);
EXPECT_CALL(*p_child, OnButtonDown(_)).InSequence(s);
HandleInput(kForwardVector, kDown);
EXPECT_CALL(*p_child, OnMove(_)).InSequence(s);
EXPECT_CALL(*p_child, OnHoverMove(_)).InSequence(s);
EXPECT_CALL(*p_child, OnButtonUp(_)).InSequence(s);
EXPECT_CALL(*p_element, OnFocusChanged(false)).InSequence(s);
HandleInput(kForwardVector, kUp);
......@@ -284,18 +284,18 @@ TEST_F(UiInputManagerTest, HoverClick) {
// Move over the test element.
EXPECT_CALL(*p_element, OnHoverEnter(_));
HandleInput(kForwardVector, kUp);
EXPECT_CALL(*p_element, OnMove(_));
EXPECT_CALL(*p_element, OnHoverMove(_));
HandleInput(kForwardVector, kUp);
Mock::VerifyAndClearExpectations(p_element);
// Press the button while on the element.
EXPECT_CALL(*p_element, OnMove(_));
EXPECT_CALL(*p_element, OnHoverMove(_));
EXPECT_CALL(*p_element, OnButtonDown(_));
HandleInput(kForwardVector, kDown);
Mock::VerifyAndClearExpectations(p_element);
// Release the button while on the element.
EXPECT_CALL(*p_element, OnMove(_));
EXPECT_CALL(*p_element, OnHoverMove(_));
EXPECT_CALL(*p_element, OnButtonUp(_));
HandleInput(kForwardVector, kUp);
Mock::VerifyAndClearExpectations(p_element);
......@@ -343,7 +343,7 @@ TEST_F(UiInputManagerTest, ReleaseButtonOnAnotherElement) {
EXPECT_CALL(*p_front_element, OnHoverLeave());
EXPECT_CALL(*p_back_element, OnHoverEnter(_));
HandleInput(kBackwardVector, kDown);
EXPECT_CALL(*p_back_element, OnMove(_));
EXPECT_CALL(*p_back_element, OnHoverMove(_));
EXPECT_CALL(*p_front_element, OnButtonUp(_));
HandleInput(kBackwardVector, kUp);
EXPECT_CALL(*p_back_element, OnHoverLeave());
......@@ -499,7 +499,7 @@ TEST_F(UiInputManagerContentTest, NoMouseMovesDuringClick) {
// Unless we suppress content move events during clicks, this will cause us to
// call OnContentMove on the delegate. We should do this suppression, so we
// set the expected number of calls to zero.
EXPECT_CALL(*content_input_delegate_, OnMove(testing::_)).Times(0);
EXPECT_CALL(*content_input_delegate_, OnHoverMove(testing::_)).Times(0);
input_manager_->HandleInput(MsToTicks(1), RenderInfo(), controller_model,
&reticle_model, &gesture_list);
......
......@@ -1056,7 +1056,7 @@ TEST_F(UiTest, CloseButtonColorBindings) {
RunForMs(kAnimationTimeMs);
VerifyButtonColor(button, scheme.disc_button_colors.foreground,
scheme.disc_button_colors.background_down, "down");
button->hit_plane()->OnMove(gfx::PointF());
button->hit_plane()->OnHoverMove(gfx::PointF());
RunForMs(kAnimationTimeMs);
VerifyButtonColor(button, scheme.disc_button_colors.foreground,
scheme.disc_button_colors.background, "move");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment