Commit 3ca0b0f3 authored by yoshiki iguchi's avatar yoshiki iguchi Committed by Commit Bot

Rename method: cancelLongPress -> cancelPress in notifications.mojom

Now this method is used for cancelling not only long presses but also
normal presses. The change itself has been done in ARC side (ag/5382077),
so that this chromium-side CL just changes the names in the code.

Bug: b/116513513
Test: none

Change-Id: Ief379a954a560de7e4aff13caceb2f7660f60fbb
Reviewed-on: https://chromium-review.googlesource.com/c/1309384Reviewed-by: default avatarHidehiko Abe <hidehiko@chromium.org>
Reviewed-by: default avatarGreg Kerr <kerrnel@chromium.org>
Commit-Queue: Yoshiki Iguchi <yoshiki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604545}
parent bf4001e7
......@@ -105,7 +105,7 @@ class ArcNotificationContentView::EventForwarder : public ui::EventHandler {
widget->OnMouseEvent(located_event->AsMouseEvent());
} else if (located_event->IsScrollEvent()) {
widget->OnScrollEvent(located_event->AsScrollEvent());
owner_->item_->CancelLongPress();
owner_->item_->CancelPress();
} else if (located_event->IsGestureEvent() &&
event->type() != ui::ET_GESTURE_TAP) {
bool slide_handled_by_android = false;
......@@ -128,7 +128,7 @@ class ArcNotificationContentView::EventForwarder : public ui::EventHandler {
}
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN)
owner_->item_->CancelLongPress();
owner_->item_->CancelPress();
if (event->type() == ui::ET_GESTURE_SCROLL_END)
swipe_captured_ = false;
......
......@@ -84,7 +84,7 @@ class ArcNotificationItem {
virtual bool IsManuallyExpandedOrCollapsed() const = 0;
// Cancel long press operation on Android side.
virtual void CancelLongPress() = 0;
virtual void CancelPress() = 0;
// Returns the rect for which Android wants to handle all swipe events.
// Defaults to the empty rectangle.
......
......@@ -265,8 +265,8 @@ const std::string& ArcNotificationItemImpl::GetNotificationId() const {
return notification_id_;
}
void ArcNotificationItemImpl::CancelLongPress() {
manager_->CancelLongPress(notification_key_);
void ArcNotificationItemImpl::CancelPress() {
manager_->CancelPress(notification_key_);
}
} // namespace ash
......@@ -51,7 +51,7 @@ class ArcNotificationItemImpl : public ArcNotificationItem {
gfx::Rect GetSwipeInputRect() const override;
const std::string& GetNotificationKey() const override;
const std::string& GetNotificationId() const override;
void CancelLongPress() override;
void CancelPress() override;
private:
ArcNotificationManager* const manager_;
......
......@@ -515,9 +515,9 @@ void ArcNotificationManager::SetDoNotDisturbStatusOnAndroid(bool enabled) {
notifications_instance->SetDoNotDisturbStatusOnAndroid(std::move(status));
}
void ArcNotificationManager::CancelLongPress(const std::string& key) {
void ArcNotificationManager::CancelPress(const std::string& key) {
auto* notifications_instance =
ARC_GET_INSTANCE_FOR_METHOD(instance_owner_->holder(), CancelLongPress);
ARC_GET_INSTANCE_FOR_METHOD(instance_owner_->holder(), CancelPress);
// On shutdown, the ARC channel may quit earlier than notifications.
if (!notifications_instance) {
......@@ -526,7 +526,7 @@ void ArcNotificationManager::CancelLongPress(const std::string& key) {
return;
}
notifications_instance->CancelLongPress(key);
notifications_instance->CancelPress(key);
}
void ArcNotificationManager::SetNotificationConfiguration() {
......
......@@ -69,7 +69,7 @@ class ArcNotificationManager
bool IsOpeningSettingsSupported() const;
void SendNotificationToggleExpansionOnChrome(const std::string& key);
void SetDoNotDisturbStatusOnAndroid(bool enabled);
void CancelLongPress(const std::string& key);
void CancelPress(const std::string& key);
void SetNotificationConfiguration();
private:
......
......@@ -44,7 +44,7 @@ class MockArcNotificationItem : public ArcNotificationItem {
void IncrementWindowRefCount() override {}
void DecrementWindowRefCount() override {}
void OnRemoteInputActivationChanged(bool activate) override {}
void CancelLongPress() override {}
void CancelPress() override {}
arc::mojom::ArcNotificationType GetNotificationType() const override;
arc::mojom::ArcNotificationExpandState GetExpandState() const override;
......
......@@ -273,11 +273,12 @@ interface NotificationsInstance {
[MinVersion=18]
SetDoNotDisturbStatusOnAndroid@7(ArcDoNotDisturbStatus status);
// Cancels the long-press operation even during touching the view. This should
// be called when the on-going gesture is recognized not as a normal touch
// event but as a scroll event, and the on-going touch should be cancelled.
// Cancels the current press operation even during touching the view. This
// should be called when the on-going gesture is recognized not as a normal
// touch event but as a scroll event, and the on-going touch events should be
// cancelled.
[MinVersion=19]
CancelLongPress@8(string key);
CancelPress@8(string key);
// Performs the user action being deferred in Android.
[MinVersion=21]
......
......@@ -35,7 +35,7 @@ void FakeNotificationsInstance::SetDoNotDisturbStatusOnAndroid(
latest_do_not_disturb_status_ = std::move(status);
}
void FakeNotificationsInstance::CancelLongPress(const std::string& key) {}
void FakeNotificationsInstance::CancelPress(const std::string& key) {}
void FakeNotificationsInstance::InitDeprecated(
mojom::NotificationsHostPtr host_ptr) {
......
......@@ -32,7 +32,7 @@ class FakeNotificationsInstance : public mojom::NotificationsInstance {
void OpenNotificationSnoozeSettings(const std::string& key) override;
void SetDoNotDisturbStatusOnAndroid(
mojom::ArcDoNotDisturbStatusPtr status) override;
void CancelLongPress(const std::string& key) override;
void CancelPress(const std::string& key) override;
void PerformDeferredUserAction(uint32_t action_id) override;
void CancelDeferredUserAction(uint32_t action_id) override;
void SetLockScreenSettingOnAndroid(
......
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