2020-10-08 21:54:42 +02:00
|
|
|
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
2021-01-28 00:13:12 +01:00
|
|
|
index 0b22a38aefb2..c7be7da822f6 100644
|
2020-10-08 21:54:42 +02:00
|
|
|
--- chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
|
|
|
+++ chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate(
|
|
|
|
gfx::NativeWindow native_window,
|
2020-10-08 21:54:42 +02:00
|
|
|
SharesheetService* sharesheet_service)
|
2021-01-28 00:13:12 +01:00
|
|
|
: native_window_(native_window),
|
2020-10-08 21:54:42 +02:00
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_(
|
2021-01-28 00:13:12 +01:00
|
|
|
std::make_unique<SharesheetBubbleView>(native_window, this)),
|
2020-10-08 21:54:42 +02:00
|
|
|
+#endif
|
|
|
|
sharesheet_service_(sharesheet_service) {}
|
|
|
|
|
|
|
|
SharesheetServiceDelegate::~SharesheetServiceDelegate() = default;
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -36,21 +38,27 @@ void SharesheetServiceDelegate::ShowBubble(
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
2020-10-08 21:54:42 +02:00
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent),
|
|
|
|
std::move(close_callback));
|
|
|
|
+#endif
|
2021-01-28 00:13:12 +01:00
|
|
|
is_bubble_open_ = true;
|
2020-10-08 21:54:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void SharesheetServiceDelegate::OnBubbleClosed(
|
|
|
|
const base::string16& active_action) {
|
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_.release();
|
|
|
|
+#endif
|
2021-01-28 00:13:12 +01:00
|
|
|
sharesheet_service_->OnBubbleClosed(native_window_, active_action);
|
|
|
|
// This object is now deleted and nothing can be accessed any more.
|
|
|
|
// Therefore there is no need to set is_bubble_open_ to false.
|
2020-10-08 21:54:42 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void SharesheetServiceDelegate::OnActionLaunched() {
|
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_->ShowActionView();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void SharesheetServiceDelegate::OnTargetSelected(
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -74,11 +82,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width,
|
2020-10-08 21:54:42 +02:00
|
|
|
const int& height) {
|
|
|
|
DCHECK_GT(width, 0);
|
|
|
|
DCHECK_GT(height, 0);
|
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_->ResizeBubble(width, height);
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
void SharesheetServiceDelegate::CloseSharesheet() {
|
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
sharesheet_bubble_view_->CloseBubble();
|
|
|
|
+#endif
|
|
|
|
}
|
|
|
|
|
2020-12-02 23:31:49 +01:00
|
|
|
const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon(
|
2020-10-08 21:54:42 +02:00
|
|
|
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h
|
2021-01-28 00:13:12 +01:00
|
|
|
index 164a3a35a3f5..82b8c15820c9 100644
|
2020-10-08 21:54:42 +02:00
|
|
|
--- chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
|
|
+++ chrome/browser/sharesheet/sharesheet_service_delegate.h
|
2021-01-28 00:13:12 +01:00
|
|
|
@@ -65,7 +65,9 @@ class SharesheetServiceDelegate : public SharesheetController {
|
|
|
|
gfx::NativeWindow native_window_;
|
|
|
|
|
2020-10-08 21:54:42 +02:00
|
|
|
base::string16 active_action_;
|
|
|
|
+#if defined(OS_CHROMEOS)
|
|
|
|
std::unique_ptr<SharesheetBubbleView> sharesheet_bubble_view_;
|
|
|
|
+#endif
|
|
|
|
SharesheetService* sharesheet_service_;
|
|
|
|
};
|
|
|
|
|