mirror of
https://github.com/aphrody-labs/cef.git
synced 2026-10-14 05:09:23 +00:00
win: dxil.dll is no longer distributed mac: Xcode 27 (macOS 26.6+) is now required
87 lines
3.4 KiB
Diff
87 lines
3.4 KiB
Diff
diff --git content/browser/renderer_host/render_widget_host_view_aura.cc content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
index 6dd861aaf326cd27f822660895e4c426f14fddfd..3c2708cf69e666b9212525d813782443c90c83e1 100644
|
|
--- content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
+++ content/browser/renderer_host/render_widget_host_view_aura.cc
|
|
@@ -8,6 +8,7 @@
|
|
#include <memory>
|
|
#include <set>
|
|
#include <string_view>
|
|
+#include <tuple>
|
|
#include <utility>
|
|
|
|
#include "base/auto_reset.h"
|
|
@@ -57,6 +58,7 @@
|
|
#include "content/public/browser/content_browser_client.h"
|
|
#include "content/public/browser/device_service.h"
|
|
#include "content/public/browser/render_view_host.h"
|
|
+#include "content/public/browser/web_contents.h"
|
|
#include "content/public/common/page_visibility_state.h"
|
|
#include "services/service_manager/public/cpp/interface_provider.h"
|
|
#include "third_party/blink/public/common/input/web_input_event.h"
|
|
@@ -870,6 +872,9 @@ gfx::Rect RenderWidgetHostViewAura::GetViewBoundsWithoutTransform() {
|
|
void RenderWidgetHostViewAura::UpdateBackgroundColor() {
|
|
CHECK(GetBackgroundColor());
|
|
|
|
+ if (!window_) {
|
|
+ return;
|
|
+ }
|
|
SkColor4f background_color =
|
|
SkColor4f::FromColor(GetBackgroundColor().value());
|
|
window_->SetTransparent(!background_color.isOpaque());
|
|
@@ -1300,6 +1305,12 @@ void RenderWidgetHostViewAura::TransformPointToRootSurface(gfx::PointF* point) {
|
|
}
|
|
|
|
gfx::Rect RenderWidgetHostViewAura::GetBoundsInScreen() {
|
|
+ if (!root_window_bounds_callback_.is_null()) {
|
|
+ if (auto bounds = root_window_bounds_callback_.Run()) {
|
|
+ return *bounds;
|
|
+ }
|
|
+ }
|
|
+
|
|
aura::Window* top_level = window_->GetToplevelWindow();
|
|
gfx::Rect bounds(top_level->GetBoundsInScreen());
|
|
|
|
@@ -3122,6 +3133,16 @@ void RenderWidgetHostViewAura::CreateAuraWindow(aura::client::WindowType type) {
|
|
window_->SetTransparent(!background_color.isOpaque());
|
|
window_->layer()->AsSurface()->SetFallbackBackgroundColor(background_color);
|
|
UpdateFrameSinkIdRegistration();
|
|
+
|
|
+ // Do this after |window_| is created to avoid crashes on Win10.
|
|
+ // See https://crbug.com/761389.
|
|
+ auto* web_contents =
|
|
+ WebContents::FromRenderViewHost(RenderViewHost::From(host()));
|
|
+ if (web_contents) {
|
|
+ // TODO(mostynb): actually use prefs. Landing this as a separate CL
|
|
+ // first to rebaseline some unreliable layout tests.
|
|
+ std::ignore = web_contents->GetOrCreateWebPreferences();
|
|
+ }
|
|
}
|
|
|
|
void RenderWidgetHostViewAura::UpdateFrameSinkIdRegistration() {
|
|
diff --git content/browser/renderer_host/render_widget_host_view_aura.h content/browser/renderer_host/render_widget_host_view_aura.h
|
|
index 09955d46ae93f93e26bd3d940482ab8936d2e7dd..ea78be36f8e478f57c808ed6036c29f16fa38f17 100644
|
|
--- content/browser/renderer_host/render_widget_host_view_aura.h
|
|
+++ content/browser/renderer_host/render_widget_host_view_aura.h
|
|
@@ -483,6 +483,12 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
|
|
|
bool ShouldUseDefaultDeadlineOnResize() const;
|
|
|
|
+ using RootWindowBoundsCallback =
|
|
+ base::RepeatingCallback<std::optional<gfx::Rect>()>;
|
|
+ void SetRootWindowBoundsCallback(const RootWindowBoundsCallback& callback) {
|
|
+ root_window_bounds_callback_ = callback;
|
|
+ }
|
|
+
|
|
protected:
|
|
~RenderWidgetHostViewAura() override;
|
|
|
|
@@ -920,6 +926,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
|
|
|
|
bool use_default_deadline_on_resize_ = false;
|
|
|
|
+ RootWindowBoundsCallback root_window_bounds_callback_;
|
|
+
|
|
base::WeakPtrFactory<RenderWidgetHostViewAura> weak_ptr_factory_{this};
|
|
};
|
|
|