diff --git a/cef/patch/fix-base-ref-counted-limits-error.patch b/cef/patch/fix-base-ref-counted-limits-error.patch new file mode 100755 index 0000000..713be19 --- /dev/null +++ b/cef/patch/fix-base-ref-counted-limits-error.patch @@ -0,0 +1,13 @@ +diff --git a/base/memory/ref_counted.h b/base/memory/ref_counted.h +index 9ef94d84769df..8e5b3a740f253 100644 +--- a/base/memory/ref_counted.h ++++ b/base/memory/ref_counted.h +@@ -9,6 +9,8 @@ + + #include + ++#include ++ + #include "base/atomic_ref_count.h" + #include "base/base_export.h" + #include "base/check.h" diff --git a/cef/patch/fix-llvm15-is-trivially-copyable-warning.patch b/cef/patch/fix-llvm15-is-trivially-copyable-warning.patch new file mode 100644 index 0000000..cfa327d --- /dev/null +++ b/cef/patch/fix-llvm15-is-trivially-copyable-warning.patch @@ -0,0 +1,20 @@ +diff --git a/include/base/cef_template_util.h b/include/base/cef_template_util.h +index 6661fc035..5d6c9cdf1 100644 +--- a/cef/include/base/cef_template_util.h ++++ b/cef/include/base/cef_template_util.h +@@ -166,15 +166,7 @@ struct priority_tag<0> {}; + defined(CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX) + template + struct is_trivially_copyable { +-// TODO(danakj): Remove this when android builders are all using a newer version +-// of gcc, or the android ndk is updated to a newer libc++ that does this for +-// us. +-#if _GNUC_VER >= 501 + static constexpr bool value = __is_trivially_copyable(T); +-#else +- static constexpr bool value = +- __has_trivial_copy(T) && __has_trivial_destructor(T); +-#endif + }; + #else + template diff --git a/cef/patch/fix-llvm15-views-incomplete-type-errors.patch b/cef/patch/fix-llvm15-views-incomplete-type-errors.patch new file mode 100644 index 0000000..3775e06 --- /dev/null +++ b/cef/patch/fix-llvm15-views-incomplete-type-errors.patch @@ -0,0 +1,91 @@ +diff --git a/include/views/cef_browser_view.h b/include/views/cef_browser_view.h +index e8b4218ff..da06146b3 100644 +--- a/cef/include/views/cef_browser_view.h ++++ b/cef/include/views/cef_browser_view.h +@@ -39,9 +39,10 @@ + #pragma once + + #include "include/cef_browser.h" +-#include "include/views/cef_browser_view_delegate.h" + #include "include/views/cef_view.h" + ++class CefBrowserViewDelegate; ++ + /// + /// A View hosting a CefBrowser instance. Methods must be called on the browser + /// process UI thread unless otherwise indicated. +diff --git a/include/views/cef_browser_view_delegate.h b/include/views/cef_browser_view_delegate.h +index 262c14521..5da26949c 100644 +--- a/cef/include/views/cef_browser_view_delegate.h ++++ b/cef/include/views/cef_browser_view_delegate.h +@@ -40,9 +40,7 @@ + + #include "include/cef_client.h" + #include "include/views/cef_view_delegate.h" +- +-class CefBrowser; +-class CefBrowserView; ++#include "include/views/cef_browser_view.h" + + /// + /// Implement this interface to handle BrowserView events. The methods of this +diff --git a/include/views/cef_view.h b/include/views/cef_view.h +index 9bfd1f47b..55bcb17ce 100644 +--- a/cef/include/views/cef_view.h ++++ b/cef/include/views/cef_view.h +@@ -38,13 +38,14 @@ + #define CEF_INCLUDE_VIEWS_CEF_VIEW_H_ + #pragma once + +-#include "include/views/cef_view_delegate.h" ++#include "include/cef_base.h" + + class CefBrowserView; + class CefButton; + class CefPanel; + class CefScrollView; + class CefTextfield; ++class CefViewDelegate; + class CefWindow; + + /// +diff --git a/include/views/cef_view_delegate.h b/include/views/cef_view_delegate.h +index 23878323e..96c30b8b9 100644 +--- a/cef/include/views/cef_view_delegate.h ++++ b/cef/include/views/cef_view_delegate.h +@@ -39,8 +39,7 @@ + #pragma once + + #include "include/cef_base.h" +- +-class CefView; ++#include "include/views/cef_view.h" + + /// + /// Implement this interface to handle view events. All size and position values +diff --git a/tests/cefsimple/simple_app.cc b/tests/cefsimple/simple_app.cc +index 72556cf5a..01ed859b1 100644 +--- a/cef/tests/cefsimple/simple_app.cc ++++ b/cef/tests/cefsimple/simple_app.cc +@@ -8,7 +8,7 @@ + + #include "include/cef_browser.h" + #include "include/cef_command_line.h" +-#include "include/views/cef_browser_view.h" ++#include "include/views/cef_browser_view_delegate.h" + #include "include/views/cef_window.h" + #include "include/wrapper/cef_helpers.h" + #include "tests/cefsimple/simple_handler.h" +diff --git a/tests/ceftests/test_handler.cc b/tests/ceftests/test_handler.cc +index 3ebf4ae16..d7caa27e8 100644 +--- a/cef/tests/ceftests/test_handler.cc ++++ b/cef/tests/ceftests/test_handler.cc +@@ -8,7 +8,7 @@ + #include "include/base/cef_logging.h" + #include "include/cef_command_line.h" + #include "include/cef_stream.h" +-#include "include/views/cef_browser_view.h" ++#include "include/views/cef_browser_view_delegate.h" + #include "include/views/cef_window.h" + #include "include/wrapper/cef_closure_task.h" + #include "include/wrapper/cef_stream_resource_handler.h" diff --git a/cef/patch/fix-sql-virtualcursor-error.patch b/cef/patch/fix-sql-virtualcursor-error.patch new file mode 100644 index 0000000..5448a59 --- /dev/null +++ b/cef/patch/fix-sql-virtualcursor-error.patch @@ -0,0 +1,216 @@ +diff --git a/sql/recover_module/btree.cc b/sql/recover_module/btree.cc +index 56fee9ae51d72..36e8a5a98ad64 100644 +--- a/sql/recover_module/btree.cc ++++ b/sql/recover_module/btree.cc +@@ -136,16 +136,25 @@ static_assert(std::is_trivially_destructible::value, + "Move the destructor to the .cc file if it's non-trival"); + #endif // !DCHECK_IS_ON() + +-LeafPageDecoder::LeafPageDecoder(DatabasePageReader* db_reader) noexcept +- : page_id_(db_reader->page_id()), +- db_reader_(db_reader), +- cell_count_(ComputeCellCount(db_reader)), +- next_read_index_(0), +- last_record_size_(0) { ++void LeafPageDecoder::Initialize(DatabasePageReader* db_reader) { ++ DCHECK(db_reader); + DCHECK(IsOnValidPage(db_reader)); ++ page_id_ = db_reader->page_id(); ++ db_reader_ = db_reader; ++ cell_count_ = ComputeCellCount(db_reader); ++ next_read_index_ = 0; ++ last_record_size_ = 0; + DCHECK(DatabasePageReader::IsValidPageId(page_id_)); + } + ++void LeafPageDecoder::Reset() { ++ db_reader_ = nullptr; ++ page_id_ = 0; ++ cell_count_ = 0; ++ next_read_index_ = 0; ++ last_record_size_ = 0; ++} ++ + bool LeafPageDecoder::TryAdvance() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(CanAdvance()); +diff --git a/sql/recover_module/btree.h b/sql/recover_module/btree.h +index 6737a91983281..f7d5b8fd276c7 100644 +--- a/sql/recover_module/btree.h ++++ b/sql/recover_module/btree.h +@@ -103,7 +103,7 @@ class LeafPageDecoder { + // + // |db_reader| must have been used to read an inner page of a table B-tree. + // |db_reader| must outlive this instance. +- explicit LeafPageDecoder(DatabasePageReader* db_reader) noexcept; ++ explicit LeafPageDecoder() noexcept = default; + ~LeafPageDecoder() noexcept = default; + + LeafPageDecoder(const LeafPageDecoder&) = delete; +@@ -151,6 +151,15 @@ class LeafPageDecoder { + // read as long as CanAdvance() returns true. + bool TryAdvance(); + ++ // Initialize with DatabasePageReader ++ void Initialize(DatabasePageReader* db_reader); ++ ++ // Reset internal DatabasePageReader ++ void Reset(); ++ ++ // True if DatabasePageReader is valid ++ bool IsValid() { return (db_reader_ != nullptr); } ++ + // True if the given reader may point to an inner page in a table B-tree. + // + // The last ReadPage() call on |db_reader| must have succeeded. +@@ -164,14 +173,14 @@ class LeafPageDecoder { + static int ComputeCellCount(DatabasePageReader* db_reader); + + // The number of the B-tree page this reader is reading. +- const int64_t page_id_; ++ int64_t page_id_; + // Used to read the tree page. + // + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the DatabasePageReader outlives this. +- DatabasePageReader* const db_reader_; ++ DatabasePageReader* db_reader_; + // Caches the ComputeCellCount() value for this reader's page. +- const int cell_count_ = ComputeCellCount(db_reader_); ++ int cell_count_; + + // The reader's cursor state. + // +diff --git a/sql/recover_module/cursor.cc b/sql/recover_module/cursor.cc +index 06a4cd2d2881e..0dd89e8499dce 100644 +--- a/sql/recover_module/cursor.cc ++++ b/sql/recover_module/cursor.cc +@@ -28,7 +28,7 @@ VirtualCursor::~VirtualCursor() { + int VirtualCursor::First() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + inner_decoders_.clear(); +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + + AppendPageDecoder(table_->root_page_id()); + return Next(); +@@ -38,18 +38,18 @@ int VirtualCursor::Next() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + record_reader_.Reset(); + +- while (!inner_decoders_.empty() || leaf_decoder_.get()) { +- if (leaf_decoder_.get()) { +- if (!leaf_decoder_->CanAdvance()) { ++ while (!inner_decoders_.empty() || leaf_decoder_.IsValid()) { ++ if (leaf_decoder_.IsValid()) { ++ if (!leaf_decoder_.CanAdvance()) { + // The leaf has been exhausted. Remove it from the DFS stack. +- leaf_decoder_ = nullptr; ++ leaf_decoder_.Reset(); + continue; + } +- if (!leaf_decoder_->TryAdvance()) ++ if (!leaf_decoder_.TryAdvance()) + continue; + +- if (!payload_reader_.Initialize(leaf_decoder_->last_record_size(), +- leaf_decoder_->last_record_offset())) { ++ if (!payload_reader_.Initialize(leaf_decoder_.last_record_size(), ++ leaf_decoder_.last_record_offset())) { + continue; + } + if (!record_reader_.Initialize()) +@@ -101,13 +101,13 @@ int VirtualCursor::ReadColumn(int column_index, + int64_t VirtualCursor::RowId() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(record_reader_.IsInitialized()); +- DCHECK(leaf_decoder_.get()); +- return leaf_decoder_->last_record_rowid(); ++ DCHECK(leaf_decoder_.IsValid()); ++ return leaf_decoder_.last_record_rowid(); + } + + void VirtualCursor::AppendPageDecoder(int page_id) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- DCHECK(leaf_decoder_.get() == nullptr) ++ DCHECK(leaf_decoder_.IsValid()) + << __func__ + << " must only be called when the current path has no leaf decoder"; + +@@ -115,7 +115,7 @@ void VirtualCursor::AppendPageDecoder(int page_id) { + return; + + if (LeafPageDecoder::IsOnValidPage(&db_reader_)) { +- leaf_decoder_ = std::make_unique(&db_reader_); ++ leaf_decoder_.Initialize(&db_reader_); + return; + } + +diff --git a/sql/recover_module/cursor.h b/sql/recover_module/cursor.h +index 1970bdca8c6f1..d069e5abff2ca 100644 +--- a/sql/recover_module/cursor.h ++++ b/sql/recover_module/cursor.h +@@ -130,7 +130,7 @@ class VirtualCursor { + std::vector> inner_decoders_; + + // Decodes the leaf page containing records. +- std::unique_ptr leaf_decoder_; ++ LeafPageDecoder leaf_decoder_; + + SEQUENCE_CHECKER(sequence_checker_); + }; +diff --git a/sql/recover_module/pager.cc b/sql/recover_module/pager.cc +index 1f7c97ad5c934..3020b25d9b263 100644 +--- a/sql/recover_module/pager.cc ++++ b/sql/recover_module/pager.cc +@@ -23,8 +23,7 @@ static_assert(DatabasePageReader::kMaxPageId <= std::numeric_limits::max(), + "ints are not appropriate for representing page IDs"); + + DatabasePageReader::DatabasePageReader(VirtualTable* table) +- : page_data_(std::make_unique(table->page_size())), +- table_(table) { ++ : page_data_(), table_(table) { + DCHECK(table != nullptr); + DCHECK(IsValidPageSize(table->page_size())); + } +@@ -57,8 +56,8 @@ int DatabasePageReader::ReadPage(int page_id) { + std::numeric_limits::max(), + "The |read_offset| computation above may overflow"); + +- int sqlite_status = +- RawRead(sqlite_file, read_size, read_offset, page_data_.get()); ++ int sqlite_status = RawRead(sqlite_file, read_size, read_offset, ++ const_cast(page_data_.data())); + + // |page_id_| needs to be set to kInvalidPageId if the read failed. + // Otherwise, future ReadPage() calls with the previous |page_id_| value +diff --git a/sql/recover_module/pager.h b/sql/recover_module/pager.h +index d3ae47e5ec81a..83fcd9ca4eb32 100644 +--- a/sql/recover_module/pager.h ++++ b/sql/recover_module/pager.h +@@ -5,6 +5,7 @@ + #ifndef SQL_RECOVER_MODULE_PAGER_H_ + #define SQL_RECOVER_MODULE_PAGER_H_ + ++#include + #include + #include + #include +@@ -72,7 +73,7 @@ class DatabasePageReader { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK_NE(page_id_, kInvalidPageId) + << "Successful ReadPage() required before accessing pager state"; +- return page_data_.get(); ++ return page_data_.data(); + } + + // The number of bytes in the page read by the last ReadPage() call. +@@ -139,7 +140,7 @@ class DatabasePageReader { + int page_id_ = kInvalidPageId; + // Stores the bytes of the last page successfully read by ReadPage(). + // The content is undefined if the last call to ReadPage() did not succeed. +- const std::unique_ptr page_data_; ++ const std::array page_data_; + // Raw pointer usage is acceptable because this instance's owner is expected + // to ensure that the VirtualTable outlives this. + const raw_ptr table_; diff --git a/cef/patch/transparent-views.patch b/cef/patch/transparent-views.patch new file mode 100644 index 0000000..8ad70d1 --- /dev/null +++ b/cef/patch/transparent-views.patch @@ -0,0 +1,318 @@ +diff --git a/include/internal/cef_types.h b/include/internal/cef_types.h +index 810dc5241..77521dec6 100644 +--- a/cef/include/internal/cef_types.h ++++ b/cef/include/internal/cef_types.h +@@ -401,8 +401,8 @@ typedef struct _cef_settings_t { + /// opaque then the RGB components will be used as the background color. If + /// the alpha component is fully transparent for a windowed browser then the + /// default value of opaque white be used. If the alpha component is fully +- /// transparent for a windowless (off-screen) browser then transparent +- /// painting will be enabled. ++ /// transparent for a windowless (off-screen) browser or a frameless window ++ /// using Views framework then transparent painting will be enabled. + /// + cef_color_t background_color; + +@@ -627,8 +627,8 @@ typedef struct _cef_browser_settings_t { + /// opaque then the RGB components will be used as the background color. If + /// the alpha component is fully transparent for a windowed browser then the + /// CefSettings.background_color value will be used. If the alpha component is +- /// fully transparent for a windowless (off-screen) browser then transparent +- /// painting will be enabled. ++ /// fully transparent for a windowless (off-screen) browser or a frameless ++ /// window using Views framework then transparent painting will be enabled. + /// + cef_color_t background_color; + +diff --git a/libcef/browser/browser_host_base.cc b/libcef/browser/browser_host_base.cc +index 990be9722..8a1ee5b6e 100644 +--- a/cef/libcef/browser/browser_host_base.cc ++++ b/cef/libcef/browser/browser_host_base.cc +@@ -1015,7 +1015,7 @@ int CefBrowserHostBase::browser_id() const { + SkColor CefBrowserHostBase::GetBackgroundColor() const { + // Don't use |platform_delegate_| because it's not thread-safe. + return CefContext::Get()->GetBackgroundColor( +- &settings_, IsWindowless() ? STATE_ENABLED : STATE_DISABLED); ++ &settings_, IsWindowless() || is_views_hosted() ? STATE_ENABLED : STATE_DISABLED); + } + + bool CefBrowserHostBase::IsWindowless() const { +diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc +index 291b1563a..08c54d412 100644 +--- a/cef/libcef/browser/browser_platform_delegate_create.cc ++++ b/cef/libcef/browser/browser_platform_delegate_create.cc +@@ -75,8 +75,9 @@ std::unique_ptr CefBrowserPlatformDelegate::Create( + create_params.window_info && + create_params.window_info->windowless_rendering_enabled && + create_params.client && create_params.client->GetRenderHandler().get(); ++ const bool is_views_hosted = create_params.browser_view || create_params.popup_with_views_hosted_opener; + const SkColor background_color = CefContext::Get()->GetBackgroundColor( +- &create_params.settings, is_windowless ? STATE_ENABLED : STATE_DISABLED); ++ &create_params.settings, is_windowless || is_views_hosted ? STATE_ENABLED : STATE_DISABLED); + + if (cef::IsChromeRuntimeEnabled()) { + CefWindowInfo window_info; +@@ -93,8 +94,7 @@ std::unique_ptr CefBrowserPlatformDelegate::Create( + return std::make_unique( + std::move(native_delegate), + static_cast(create_params.browser_view.get())); +- } else if (create_params.browser_view || +- create_params.popup_with_views_hosted_opener) { ++ } else if (is_views_hosted) { + // CefWindowInfo is not used in this case. + return std::make_unique( + std::move(native_delegate), +diff --git a/libcef/browser/context.cc b/libcef/browser/context.cc +index e4539f31a..e93b1f56b 100644 +--- a/cef/libcef/browser/context.cc ++++ b/cef/libcef/browser/context.cc +@@ -67,14 +67,14 @@ void InitCrashReporter() { + + #endif // BUILDFLAG(IS_WIN) + +-bool GetColor(const cef_color_t cef_in, bool is_windowless, SkColor* sk_out) { +- // Windowed browser colors must be fully opaque. +- if (!is_windowless && CefColorGetA(cef_in) != SK_AlphaOPAQUE) { ++bool GetColor(const cef_color_t cef_in, bool is_transparent, SkColor* sk_out) { ++ // Transparent unsupported browser colors must be fully opaque. ++ if (!is_transparent && CefColorGetA(cef_in) != SK_AlphaOPAQUE) { + return false; + } + +- // Windowless browser colors may be fully transparent. +- if (is_windowless && CefColorGetA(cef_in) == SK_AlphaTRANSPARENT) { ++ // Transparent supported browser colors may be fully transparent. ++ if (is_transparent && CefColorGetA(cef_in) == SK_AlphaTRANSPARENT) { + *sk_out = SK_ColorTRANSPARENT; + return true; + } +@@ -513,10 +513,10 @@ bool CefContext::OnInitThread() { + + SkColor CefContext::GetBackgroundColor( + const CefBrowserSettings* browser_settings, +- cef_state_t windowless_state) const { +- bool is_windowless = windowless_state == STATE_ENABLED ++ cef_state_t transparent_state) const { ++ bool is_transparent = transparent_state == STATE_ENABLED + ? true +- : (windowless_state == STATE_DISABLED ++ : (transparent_state == STATE_DISABLED + ? false + : !!settings_.windowless_rendering_enabled); + +@@ -524,8 +524,8 @@ SkColor CefContext::GetBackgroundColor( + SkColor sk_color = SK_ColorWHITE; + + if (!browser_settings || +- !GetColor(browser_settings->background_color, is_windowless, &sk_color)) { +- GetColor(settings_.background_color, is_windowless, &sk_color); ++ !GetColor(browser_settings->background_color, is_transparent, &sk_color)) { ++ GetColor(settings_.background_color, is_transparent, &sk_color); + } + return sk_color; + } +diff --git a/libcef/browser/context.h b/libcef/browser/context.h +index 40530c016..97f0177c7 100644 +--- a/cef/libcef/browser/context.h ++++ b/cef/libcef/browser/context.h +@@ -62,13 +62,14 @@ class CefContext { + // Returns the background color for the browser. If |browser_settings| is + // nullptr or does not specify a color then the global settings will be used. + // The alpha component will be either SK_AlphaTRANSPARENT or SK_AlphaOPAQUE +- // (e.g. fully transparent or fully opaque). If |is_windowless| is ++ // (e.g. fully transparent or fully opaque). If |is_transparent| is + // STATE_DISABLED then SK_AlphaTRANSPARENT will always be returned. If +- // |is_windowless| is STATE_ENABLED then SK_ColorTRANSPARENT may be returned +- // to enable transparency for windowless browsers. See additional comments on +- // CefSettings.background_color and CefBrowserSettings.background_color. ++ // |transparent_state| is STATE_ENABLED then SK_ColorTRANSPARENT may be ++ // returned to enable transparency for windowless browsers or a frameless ++ // window in Views. See additional comments on CefSettings.background_color ++ // and CefBrowserSettings.background_color. + SkColor GetBackgroundColor(const CefBrowserSettings* browser_settings, +- cef_state_t windowless_state) const; ++ cef_state_t transparent_state) const; + + CefTraceSubscriber* GetTraceSubscriber(); + +diff --git a/libcef/browser/views/browser_view_impl.cc b/libcef/browser/views/browser_view_impl.cc +index 74ccef214..d83e4c007 100644 +--- a/cef/libcef/browser/views/browser_view_impl.cc ++++ b/cef/libcef/browser/views/browser_view_impl.cc +@@ -241,7 +241,7 @@ void CefBrowserViewImpl::SetPendingBrowserCreateParams( + + void CefBrowserViewImpl::SetDefaults(const CefBrowserSettings& settings) { + SetBackgroundColor( +- CefContext::Get()->GetBackgroundColor(&settings, STATE_DISABLED)); ++ CefContext::Get()->GetBackgroundColor(&settings, STATE_ENABLED)); + } + + views::View* CefBrowserViewImpl::CreateRootView() { +diff --git a/libcef/browser/views/window_view.cc b/libcef/browser/views/window_view.cc +index 0c5ee9ebc..2526edaf1 100644 +--- a/cef/libcef/browser/views/window_view.cc ++++ b/cef/libcef/browser/views/window_view.cc +@@ -5,6 +5,7 @@ + #include "libcef/browser/views/window_view.h" + + #include "libcef/browser/chrome/views/chrome_browser_frame.h" ++#include "libcef/browser/context.h" + #include "libcef/browser/image_impl.h" + #include "libcef/browser/views/window_impl.h" + #include "libcef/features/runtime.h" +@@ -276,6 +277,9 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) { + bool can_activate = true; + bool can_resize = true; + ++ auto color = CefContext::Get()->GetBackgroundColor(nullptr, STATE_ENABLED); ++ bool is_translucent = color == SK_ColorTRANSPARENT; ++ + const bool has_native_parent = parent_widget != gfx::kNullAcceleratedWidget; + if (has_native_parent) { + params.parent_widget = parent_widget; +@@ -294,6 +298,8 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) { + params.opacity = views::Widget::InitParams::WindowOpacity::kOpaque; + } else { + params.type = views::Widget::InitParams::TYPE_WINDOW; ++ if (is_translucent) ++ params.opacity = views::Widget::InitParams::WindowOpacity::kTranslucent; + } + + // WidgetDelegate::DeleteDelegate() will delete |this| after executing the +@@ -401,6 +407,9 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) { + } + #endif + #endif ++ ++ if (is_translucent) ++ GetCefWindow()->SetBackgroundColor(SK_ColorTRANSPARENT); + } + + CefRefPtr CefWindowView::GetCefWindow() const { +diff --git a/tests/cefclient/browser/main_context_impl.cc b/tests/cefclient/browser/main_context_impl.cc +index 46d2db94e..d0d4a5961 100644 +--- a/cef/tests/cefclient/browser/main_context_impl.cc ++++ b/cef/tests/cefclient/browser/main_context_impl.cc +@@ -65,11 +65,6 @@ MainContextImpl::MainContextImpl(CefRefPtr command_line, + .c_str()); + } + +- // Whether transparent painting is used with windowless rendering. +- const bool use_transparent_painting = +- use_windowless_rendering_ && +- command_line_->HasSwitch(switches::kTransparentPaintingEnabled); +- + #if defined(OS_WIN) + // Shared texture is only supported on Windows. + shared_texture_enabled_ = +@@ -131,6 +126,17 @@ MainContextImpl::MainContextImpl(CefRefPtr command_line, + main_url_ = "http://tests/draggable"; + } + ++ // Whether transparent painting is used with windowless rendering. ++ const bool use_transparent_painting = ++ (use_windowless_rendering_ || use_views_) && ++ command_line_->HasSwitch(switches::kTransparentPaintingEnabled); ++ if (use_views_ && use_transparent_painting && ++ command_line->HasSwitch(switches::kHideFrame) && ++ !command_line_->HasSwitch(switches::kUrl)) { ++ // Use the draggable regions test as the default URL for frameless windows. ++ main_url_ = "http://tests/transparent_views"; ++ } ++ + if (command_line_->HasSwitch(switches::kBackgroundColor)) { + // Parse the background color value. + background_color_ = +diff --git a/tests/cefclient/browser/resource.h b/tests/cefclient/browser/resource.h +index 0bd35c866..088db6c25 100644 +--- a/cef/tests/cefclient/browser/resource.h ++++ b/cef/tests/cefclient/browser/resource.h +@@ -62,12 +62,13 @@ + #define IDS_RESPONSE_FILTER_HTML 1016 + #define IDS_SERVER_HTML 1017 + #define IDS_TRANSPARENCY_HTML 1018 +-#define IDS_URLREQUEST_HTML 1019 +-#define IDS_WEBSOCKET_HTML 1020 +-#define IDS_WINDOW_HTML 1021 +-#define IDS_WINDOW_ICON_1X_PNG 1022 +-#define IDS_WINDOW_ICON_2X_PNG 1023 +-#define IDS_XMLHTTPREQUEST_HTML 1024 ++#define IDS_TRANSPARENT_VIEWS_HTML 1019 ++#define IDS_URLREQUEST_HTML 1020 ++#define IDS_WEBSOCKET_HTML 1021 ++#define IDS_WINDOW_HTML 1022 ++#define IDS_WINDOW_ICON_1X_PNG 1023 ++#define IDS_WINDOW_ICON_2X_PNG 1024 ++#define IDS_XMLHTTPREQUEST_HTML 1025 + + #define IDS_EXTENSIONS_SET_PAGE_COLOR_ICON_PNG 1030 + #define IDS_EXTENSIONS_SET_PAGE_COLOR_MANIFEST_JSON 1031 +diff --git a/tests/cefclient/browser/resource_util_win_idmap.cc b/tests/cefclient/browser/resource_util_win_idmap.cc +index 086932c15..2d2f33834 100644 +--- a/cef/tests/cefclient/browser/resource_util_win_idmap.cc ++++ b/cef/tests/cefclient/browser/resource_util_win_idmap.cc +@@ -40,6 +40,7 @@ int GetResourceId(const char* resource_name) { + {"response_filter.html", IDS_RESPONSE_FILTER_HTML}, + {"server.html", IDS_SERVER_HTML}, + {"transparency.html", IDS_TRANSPARENCY_HTML}, ++ {"transparent_views.html", IDS_TRANSPARENT_VIEWS_HTML}, + {"urlrequest.html", IDS_URLREQUEST_HTML}, + {"websocket.html", IDS_WEBSOCKET_HTML}, + {"window.html", IDS_WINDOW_HTML}, +diff --git a/tests/cefclient/resources/win/cefclient.rc b/tests/cefclient/resources/win/cefclient.rc +index 55a54d021..5e583f722 100644 +--- a/cef/tests/cefclient/resources/win/cefclient.rc ++++ b/cef/tests/cefclient/resources/win/cefclient.rc +@@ -48,6 +48,7 @@ IDS_PREFERENCES_HTML BINARY "..\\preferences.html" + IDS_RESPONSE_FILTER_HTML BINARY "..\\response_filter.html" + IDS_SERVER_HTML BINARY "..\\server.html" + IDS_TRANSPARENCY_HTML BINARY "..\\transparency.html" ++IDS_TRANSPARENT_VIEWS_HTML BINARY "..\\transparent_views.html" + IDS_URLREQUEST_HTML BINARY "..\\urlrequest.html" + IDS_WEBSOCKET_HTML BINARY "..\\websocket.html" + IDS_WINDOW_HTML BINARY "..\\window.html" +diff --git a/tests/cefsimple/simple_app.cc b/tests/cefsimple/simple_app.cc +index 72556cf5a..cf632d2c9 100644 +--- a/cef/tests/cefsimple/simple_app.cc ++++ b/cef/tests/cefsimple/simple_app.cc +@@ -35,6 +35,12 @@ class SimpleWindowDelegate : public CefWindowDelegate { + browser_view_ = nullptr; + } + ++ bool IsFrameless(CefRefPtr window) override { ++ CefRefPtr command_line = ++ CefCommandLine::GetGlobalCommandLine(); ++ return command_line->HasSwitch("hide-frame"); ++ } ++ + bool CanClose(CefRefPtr window) override { + // Allow the window to close if the browser says it's OK. + CefRefPtr browser = browser_view_->GetBrowser(); +diff --git a/tests/ceftests/views/window_unittest.cc b/tests/ceftests/views/window_unittest.cc +index 0c8d6b824..bc7e23658 100644 +--- a/cef/tests/ceftests/views/window_unittest.cc ++++ b/cef/tests/ceftests/views/window_unittest.cc +@@ -497,6 +497,18 @@ void WindowAcceleratorImpl(CefRefPtr event) { + TestWindowDelegate::RunTest(event, std::move(config)); + } + ++void VerifyWindowTransparentBackground(CefRefPtr window) { ++ // The transparent background color value from CefSettings.background_color ++ // by set in CefTestSuite::GetSettings() to enable transparent window ++ // in Views framework. ++ EXPECT_EQ(window->GetBackgroundColor(), 0u); ++} ++void WindowCreateTranslucentImpl(CefRefPtr event) { ++ auto config = std::make_unique(); ++ config->on_window_created = base::BindOnce(VerifyWindowTransparentBackground); ++ TestWindowDelegate::RunTest(event, std::move(config)); ++} ++ + } // namespace + + // Test window functionality. This is primarily to exercise exposed CEF APIs +@@ -518,3 +530,4 @@ WINDOW_TEST_ASYNC(WindowFullscreenFrameless) + WINDOW_TEST_ASYNC(WindowIcon) + WINDOW_TEST_ASYNC(WindowIconFrameless) + WINDOW_TEST_ASYNC(WindowAccelerator) ++WINDOW_TEST_ASYNC(WindowCreateTranslucent)