[WebOTP] Support cancelling response receiving for SendMessageToDevice

This patch adds a return callback to SendMessageToDevice. If response
callback has not been executed through other paths, e.g. AckReceived,
this return callback will run the response callback. Otherwise it will
be a no-op.

It is useful in SmsRemoteFetcher where the response callback is delayed
by design. The cancel back will clean the sharing bits and remove the
UI if needed.

Bug: 1190311
Change-Id: Ia7d71b9f9f006993ba5d11aa76d8b1dba83d6cbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2775796
Reviewed-by: Richard Knoll <[email protected]>
Commit-Queue: Yi Gu <[email protected]>
Cr-Commit-Position: refs/heads/master@{#865663}
diff --git a/chrome/browser/sharing/sharing_message_sender.h b/chrome/browser/sharing/sharing_message_sender.h
index 82ce0311..8e5ddf3 100644
--- a/chrome/browser/sharing/sharing_message_sender.h
+++ b/chrome/browser/sharing/sharing_message_sender.h
@@ -64,7 +64,7 @@
   SharingMessageSender& operator=(const SharingMessageSender&) = delete;
   virtual ~SharingMessageSender();
 
-  virtual void SendMessageToDevice(
+  virtual base::OnceClosure SendMessageToDevice(
       const syncer::DeviceInfo& device,
       base::TimeDelta response_timeout,
       chrome_browser_sharing::SharingMessage message,