74 lines
2.6 KiB
Diff
74 lines
2.6 KiB
Diff
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
|
index 0b22a38aefb2..c7be7da822f6 100644
|
|
--- chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
|
+++ chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
|
@@ -19,8 +19,10 @@ SharesheetServiceDelegate::SharesheetServiceDelegate(
|
|
gfx::NativeWindow native_window,
|
|
SharesheetService* sharesheet_service)
|
|
: native_window_(native_window),
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_(
|
|
std::make_unique<SharesheetBubbleView>(native_window, this)),
|
|
+#endif
|
|
sharesheet_service_(sharesheet_service) {}
|
|
|
|
SharesheetServiceDelegate::~SharesheetServiceDelegate() = default;
|
|
@@ -36,21 +38,27 @@ void SharesheetServiceDelegate::ShowBubble(
|
|
}
|
|
return;
|
|
}
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent),
|
|
std::move(close_callback));
|
|
+#endif
|
|
is_bubble_open_ = true;
|
|
}
|
|
|
|
void SharesheetServiceDelegate::OnBubbleClosed(
|
|
const base::string16& active_action) {
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_.release();
|
|
+#endif
|
|
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.
|
|
}
|
|
|
|
void SharesheetServiceDelegate::OnActionLaunched() {
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_->ShowActionView();
|
|
+#endif
|
|
}
|
|
|
|
void SharesheetServiceDelegate::OnTargetSelected(
|
|
@@ -74,11 +82,15 @@ void SharesheetServiceDelegate::SetSharesheetSize(const int& width,
|
|
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
|
|
}
|
|
|
|
const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon(
|
|
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
index 164a3a35a3f5..82b8c15820c9 100644
|
|
--- chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
+++ chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
@@ -65,7 +65,9 @@ class SharesheetServiceDelegate : public SharesheetController {
|
|
gfx::NativeWindow native_window_;
|
|
|
|
base::string16 active_action_;
|
|
+#if defined(OS_CHROMEOS)
|
|
std::unique_ptr<SharesheetBubbleView> sharesheet_bubble_view_;
|
|
+#endif
|
|
SharesheetService* sharesheet_service_;
|
|
};
|
|
|