Commit d1a8ba92 authored by Melissa Zhang's avatar Melissa Zhang Committed by Commit Bot

[Sharesheet] Close sharesheet on button press.

This CL closes the sharesheet once an app is launched.

Bug: 1097623
Change-Id: I72ab0f8ff39569a4fd14a1f3f3efd1df46af7f0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2338154Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Melissa Zhang <melzhang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795725}
parent 4937cc62
...@@ -19,7 +19,7 @@ class SharesheetController { ...@@ -19,7 +19,7 @@ class SharesheetController {
// Called by ShareAction to notify SharesheetBubbleView that ShareAction // Called by ShareAction to notify SharesheetBubbleView that ShareAction
// has completed. // has completed.
virtual void ShareActionCompleted() = 0; virtual void CloseSharesheet() = 0;
}; };
} // namespace sharesheet } // namespace sharesheet
......
...@@ -100,6 +100,7 @@ void SharesheetService::OnTargetSelected(uint32_t delegate_id, ...@@ -100,6 +100,7 @@ void SharesheetService::OnTargetSelected(uint32_t delegate_id,
WindowOpenDisposition::NEW_WINDOW, WindowOpenDisposition::NEW_WINDOW,
/*prefer_container=*/true), /*prefer_container=*/true),
std::move(intent), launch_source, display::kDefaultDisplayId); std::move(intent), launch_source, display::kDefaultDisplayId);
delegate->CloseSharesheet();
} }
} }
......
...@@ -63,7 +63,7 @@ uint32_t SharesheetServiceDelegate::GetId() { ...@@ -63,7 +63,7 @@ uint32_t SharesheetServiceDelegate::GetId() {
return id_; return id_;
} }
void SharesheetServiceDelegate::ShareActionCompleted() { void SharesheetServiceDelegate::CloseSharesheet() {
sharesheet_bubble_view_->CloseBubble(); sharesheet_bubble_view_->CloseBubble();
} }
......
...@@ -52,7 +52,7 @@ class SharesheetServiceDelegate : public SharesheetController { ...@@ -52,7 +52,7 @@ class SharesheetServiceDelegate : public SharesheetController {
// SharesheetController overrides // SharesheetController overrides
uint32_t GetId() override; uint32_t GetId() override;
void ShareActionCompleted() override; void CloseSharesheet() override;
private: private:
const uint32_t id_; const uint32_t id_;
......
...@@ -190,7 +190,6 @@ void SharesheetBubbleView::ButtonPressed(views::Button* sender, ...@@ -190,7 +190,6 @@ void SharesheetBubbleView::ButtonPressed(views::Button* sender,
delegate_->OnTargetSelected(targets_[sender->tag()].launch_name, type, delegate_->OnTargetSelected(targets_[sender->tag()].launch_name, type,
std::move(intent_), share_action_view_); std::move(intent_), share_action_view_);
intent_.reset(); intent_.reset();
RequestFocus();
} }
std::unique_ptr<views::NonClientFrameView> std::unique_ptr<views::NonClientFrameView>
......
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