mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-03-03 19:37:47 +01:00
87 lines
3.0 KiB
Diff
87 lines
3.0 KiB
Diff
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.cc chrome/browser/sharesheet/sharesheet_service_delegate.cc
|
|
index 3cb0c531e382e..a40b50e060483 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,8 +38,10 @@ void SharesheetServiceDelegate::ShowBubble(
|
|
}
|
|
return;
|
|
}
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_->ShowBubble(std::move(targets), std::move(intent),
|
|
std::move(delivered_callback));
|
|
+#endif
|
|
is_bubble_open_ = true;
|
|
}
|
|
|
|
@@ -52,15 +56,19 @@ void SharesheetServiceDelegate::ShowNearbyShareBubble(
|
|
}
|
|
return;
|
|
}
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_->ShowNearbyShareBubble(std::move(intent),
|
|
std::move(delivered_callback));
|
|
+#endif
|
|
is_bubble_open_ = true;
|
|
}
|
|
#endif // BUILDFLAG(IS_CHROMEOS_ASH)
|
|
|
|
void SharesheetServiceDelegate::OnBubbleClosed(
|
|
const std::u16string& 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.
|
|
@@ -82,7 +90,9 @@ bool SharesheetServiceDelegate::OnAcceleratorPressed(
|
|
}
|
|
|
|
void SharesheetServiceDelegate::OnActionLaunched() {
|
|
+#if defined(OS_CHROMEOS)
|
|
sharesheet_bubble_view_->ShowActionView();
|
|
+#endif
|
|
}
|
|
|
|
const gfx::VectorIcon* SharesheetServiceDelegate::GetVectorIcon(
|
|
@@ -102,11 +112,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
|
|
}
|
|
|
|
} // namespace sharesheet
|
|
diff --git chrome/browser/sharesheet/sharesheet_service_delegate.h chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
index cba3392d1057c..b307678693797 100644
|
|
--- chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
+++ chrome/browser/sharesheet/sharesheet_service_delegate.h
|
|
@@ -72,7 +72,9 @@ class SharesheetServiceDelegate : public SharesheetController {
|
|
gfx::NativeWindow native_window_;
|
|
|
|
std::u16string active_action_;
|
|
+#if defined(OS_CHROMEOS)
|
|
std::unique_ptr<SharesheetBubbleView> sharesheet_bubble_view_;
|
|
+#endif
|
|
SharesheetService* sharesheet_service_;
|
|
};
|
|
|