mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Compare commits
20 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
b09c4ca5f8 | ||
|
06a2f796b3 | ||
|
1ee0aee454 | ||
|
d000e45ee4 | ||
|
3303e87ba1 | ||
|
09ce0e709d | ||
|
ef29713a46 | ||
|
aad7246e7f | ||
|
208a5f3499 | ||
|
7e7301c7b0 | ||
|
ee888e5b3f | ||
|
25c811254c | ||
|
1bcb2c1cf8 | ||
|
f8b9812cb4 | ||
|
798bc0e9cc | ||
|
12c88501fd | ||
|
8656630d99 | ||
|
1316cc17b6 | ||
|
0a165d44d6 | ||
|
6df4fcb125 |
@@ -7,5 +7,6 @@
|
||||
# https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
|
||||
{
|
||||
'chromium_checkout': 'refs/tags/112.0.5615.0'
|
||||
'chromium_checkout': 'refs/tags/112.0.5615.165',
|
||||
'depot_tools_checkout': '424814829a'
|
||||
}
|
||||
|
@@ -9,6 +9,7 @@ The Chromium Embedded Framework (CEF) is a simple framework for embedding Chromi
|
||||
* Branches and Building - https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
|
||||
* Announcements - https://groups.google.com/forum/#!forum/cef-announce
|
||||
* Support Forum - http://www.magpcss.org/ceforum/
|
||||
* Issue Tracker - https://github.com/chromiumembedded/cef/issues
|
||||
* C++ API Docs - [Stable release docs](https://cef-builds.spotifycdn.com/docs/stable.html) / [Beta release docs](https://cef-builds.spotifycdn.com/docs/beta.html)
|
||||
* Downloads - https://cef-builds.spotifycdn.com/index.html
|
||||
* Donations - http://www.magpcss.org/ceforum/donate.php
|
||||
@@ -57,7 +58,7 @@ If you're the maintainer of a project not listed above and would like your proje
|
||||
|
||||
CEF is still very much a work in progress. Some ways that you can help out:
|
||||
|
||||
\- Vote for issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) that are important to you. This helps with development prioritization.
|
||||
\- Vote for issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) that are important to you. This helps with development prioritization.
|
||||
|
||||
\- Report any bugs that you find or feature requests that are important to you. Make sure to first search for existing issues before creating new ones. Please use the [CEF Forum](http://magpcss.org/ceforum) and not the issue tracker for usage questions. Each CEF issue should:
|
||||
|
||||
@@ -68,7 +69,7 @@ CEF is still very much a work in progress. Some ways that you can help out:
|
||||
|
||||
\- Write unit tests for new or existing functionality.
|
||||
|
||||
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://bitbucket.org/chromiumembedded/cef/issues?status=new&status=open) or search for TODO(cef) in the source code for ideas.
|
||||
\- Pull requests and patches are welcome. View open issues in the [CEF issue tracker](https://github.com/chromiumembedded/cef/issues) or search for TODO(cef) in the source code for ideas.
|
||||
|
||||
If you would like to contribute source code changes to CEF please follow the below guidelines:
|
||||
|
||||
|
@@ -393,6 +393,7 @@
|
||||
'tests/cefclient/browser/temp_window_mac.mm',
|
||||
'tests/cefclient/browser/text_input_client_osr_mac.h',
|
||||
'tests/cefclient/browser/text_input_client_osr_mac.mm',
|
||||
'tests/cefclient/browser/views_window_mac.mm',
|
||||
'tests/cefclient/browser/window_test_runner_mac.h',
|
||||
'tests/cefclient/browser/window_test_runner_mac.mm',
|
||||
'tests/cefclient/cefclient_mac.mm',
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=46817ef557307a55a9b7138134c4f5c32562f2d7$
|
||||
// $hash=0cbb756a64d2aca1075480b5188b36cae533864d$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_CEF_COMMAND_HANDLER_CAPI_H_
|
||||
@@ -71,6 +71,46 @@ typedef struct _cef_command_handler_t {
|
||||
struct _cef_browser_t* browser,
|
||||
int command_id,
|
||||
cef_window_open_disposition_t disposition);
|
||||
|
||||
///
|
||||
/// Called to check if a Chrome app menu item should be visible. Values for
|
||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
||||
/// menu items that would be visible by default. Only used with the Chrome
|
||||
/// runtime.
|
||||
///
|
||||
int(CEF_CALLBACK* is_chrome_app_menu_item_visible)(
|
||||
struct _cef_command_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
/// Called to check if a Chrome app menu item should be enabled. Values for
|
||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
||||
/// menu items that would be enabled by default. Only used with the Chrome
|
||||
/// runtime.
|
||||
///
|
||||
int(CEF_CALLBACK* is_chrome_app_menu_item_enabled)(
|
||||
struct _cef_command_handler_t* self,
|
||||
struct _cef_browser_t* browser,
|
||||
int command_id);
|
||||
|
||||
///
|
||||
/// Called during browser creation to check if a Chrome page action icon
|
||||
/// should be visible. Only called for icons that would be visible by default.
|
||||
/// Only used with the Chrome runtime.
|
||||
///
|
||||
int(CEF_CALLBACK* is_chrome_page_action_icon_visible)(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_chrome_page_action_icon_type_t icon_type);
|
||||
|
||||
///
|
||||
/// Called during browser creation to check if a Chrome toolbar button should
|
||||
/// be visible. Only called for buttons that would be visible by default. Only
|
||||
/// used with the Chrome runtime.
|
||||
///
|
||||
int(CEF_CALLBACK* is_chrome_toolbar_button_visible)(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_chrome_toolbar_button_type_t button_type);
|
||||
} cef_command_handler_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -33,7 +33,7 @@
|
||||
// by hand. See the translator.README.txt file in the tools directory for
|
||||
// more information.
|
||||
//
|
||||
// $hash=9f0389a439e6787282880d53375369829adb6a3d$
|
||||
// $hash=7201d268e16fc89f255b6ccd00d043f34fe77584$
|
||||
//
|
||||
|
||||
#ifndef CEF_INCLUDE_CAPI_VIEWS_CEF_WINDOW_DELEGATE_CAPI_H_
|
||||
@@ -139,7 +139,7 @@ typedef struct _cef_window_delegate_t {
|
||||
|
||||
///
|
||||
/// Return true (1) if |window| should be created with standard window buttons
|
||||
/// like close, minimize and zoom.
|
||||
/// like close, minimize and zoom. This function is only supported on macOS.
|
||||
///
|
||||
int(CEF_CALLBACK* with_standard_window_buttons)(
|
||||
struct _cef_window_delegate_t* self,
|
||||
@@ -198,6 +198,17 @@ typedef struct _cef_window_delegate_t {
|
||||
int(CEF_CALLBACK* on_key_event)(struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
const cef_key_event_t* event);
|
||||
|
||||
///
|
||||
/// Called when the |window| is transitioning to or from fullscreen mode. The
|
||||
/// transition occurs in two stages, with |is_competed| set to false (0) when
|
||||
/// the transition starts and true (1) when the transition completes. This
|
||||
/// function is only supported on macOS.
|
||||
///
|
||||
void(CEF_CALLBACK* on_window_fullscreen_transition)(
|
||||
struct _cef_window_delegate_t* self,
|
||||
struct _cef_window_t* window,
|
||||
int is_completed);
|
||||
} cef_window_delegate_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -42,13 +42,13 @@
|
||||
// way that may cause binary incompatibility with other builds. The universal
|
||||
// hash value will change if any platform is affected whereas the platform hash
|
||||
// values will change only if that particular platform is affected.
|
||||
#define CEF_API_HASH_UNIVERSAL "847b71b49130895cf4fb59fdb5be490ca29ef4ac"
|
||||
#define CEF_API_HASH_UNIVERSAL "7c7515822b869395898c705bcc350222c26e8734"
|
||||
#if defined(OS_WIN)
|
||||
#define CEF_API_HASH_PLATFORM "34ef9830e2b8dc5e4c930db28e279e2a70d9f4bf"
|
||||
#define CEF_API_HASH_PLATFORM "54e2eed5aee11d5dbd88808a54f3e93a7bc17b0c"
|
||||
#elif defined(OS_MAC)
|
||||
#define CEF_API_HASH_PLATFORM "9152ecd1a004d3c800af9c2ca12246554f91723c"
|
||||
#define CEF_API_HASH_PLATFORM "0f491b440d7e9e318146ed06cdeca86972e801c5"
|
||||
#elif defined(OS_LINUX)
|
||||
#define CEF_API_HASH_PLATFORM "8e48aafc7f40a48499eac957fa3003c24656e23c"
|
||||
#define CEF_API_HASH_PLATFORM "b5a01a70d1d15078988ca7d694c355503d5b5ad6"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -63,6 +63,52 @@ class CefCommandHandler : public virtual CefBaseRefCounted {
|
||||
cef_window_open_disposition_t disposition) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called to check if a Chrome app menu item should be visible. Values for
|
||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
||||
/// menu items that would be visible by default. Only used with the Chrome
|
||||
/// runtime.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called to check if a Chrome app menu item should be enabled. Values for
|
||||
/// |command_id| can be found in the cef_command_ids.h file. Only called for
|
||||
/// menu items that would be enabled by default. Only used with the Chrome
|
||||
/// runtime.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool IsChromeAppMenuItemEnabled(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) {
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called during browser creation to check if a Chrome page action icon
|
||||
/// should be visible. Only called for icons that would be visible by default.
|
||||
/// Only used with the Chrome runtime.
|
||||
///
|
||||
/*--cef(optional_param=browser)--*/
|
||||
virtual bool IsChromePageActionIconVisible(
|
||||
cef_chrome_page_action_icon_type_t icon_type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called during browser creation to check if a Chrome toolbar button
|
||||
/// should be visible. Only called for buttons that would be visible by
|
||||
/// default. Only used with the Chrome runtime.
|
||||
///
|
||||
/*--cef(optional_param=browser)--*/
|
||||
virtual bool IsChromeToolbarButtonVisible(
|
||||
cef_chrome_toolbar_button_type_t button_type) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_CEF_COMMAND_HANDLER_H_
|
||||
|
@@ -122,7 +122,7 @@ CEF_EXPORT int cef_time_now(cef_time_t* cef_time);
|
||||
///
|
||||
/// Retrieve the current system time.
|
||||
///
|
||||
CEF_EXPORT cef_basetime_t cef_basetime_now();
|
||||
CEF_EXPORT cef_basetime_t cef_basetime_now(void);
|
||||
|
||||
///
|
||||
/// Retrieve the delta in milliseconds between two time values. Returns true (1)
|
||||
|
@@ -3251,7 +3251,7 @@ typedef enum {
|
||||
} cef_text_field_commands_t;
|
||||
|
||||
///
|
||||
/// Supported Chrome toolbar types.
|
||||
/// Chrome toolbar types.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_CTT_NONE = 1,
|
||||
@@ -3259,6 +3259,51 @@ typedef enum {
|
||||
CEF_CTT_LOCATION,
|
||||
} cef_chrome_toolbar_type_t;
|
||||
|
||||
///
|
||||
/// Chrome page action icon types. Should be kept in sync with Chromium's
|
||||
/// PageActionIconType type.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_CPAIT_BOOKMARK_STAR = 0,
|
||||
CEF_CPAIT_CLICK_TO_CALL,
|
||||
CEF_CPAIT_COOKIE_CONTROLS,
|
||||
CEF_CPAIT_FILE_SYSTEM_ACCESS,
|
||||
CEF_CPAIT_FIND,
|
||||
CEF_CPAIT_HIGH_EFFICIENCY,
|
||||
CEF_CPAIT_INTENT_PICKER,
|
||||
CEF_CPAIT_LOCAL_CARD_MIGRATION,
|
||||
CEF_CPAIT_MANAGE_PASSWORDS,
|
||||
CEF_CPAIT_PAYMENTS_OFFER_NOTIFICATION,
|
||||
CEF_CPAIT_PRICE_TRACKING,
|
||||
CEF_CPAIT_PWA_INSTALL,
|
||||
CEF_CPAIT_QR_CODE_GENERATOR,
|
||||
CEF_CPAIT_READER_MODE,
|
||||
CEF_CPAIT_SAVE_AUTOFILL_ADDRESS,
|
||||
CEF_CPAIT_SAVE_CARD,
|
||||
CEF_CPAIT_SEND_TAB_TO_SELF,
|
||||
CEF_CPAIT_SHARING_HUB,
|
||||
CEF_CPAIT_SIDE_SEARCH,
|
||||
CEF_CPAIT_SMS_REMOTE_FETCHER,
|
||||
CEF_CPAIT_TRANSLATE,
|
||||
CEF_CPAIT_VIRTUAL_CARD_ENROLL,
|
||||
CEF_CPAIT_VIRTUAL_CARD_MANUAL_FALLBACK,
|
||||
CEF_CPAIT_ZOOM,
|
||||
CEF_CPAIT_SAVE_IBAN,
|
||||
CEF_CPAIT_MAX_VALUE = CEF_CPAIT_SAVE_IBAN,
|
||||
} cef_chrome_page_action_icon_type_t;
|
||||
|
||||
///
|
||||
/// Chrome toolbar button types. Should be kept in sync with CEF's internal
|
||||
/// ToolbarButtonType type.
|
||||
///
|
||||
typedef enum {
|
||||
CEF_CTBT_CAST = 0,
|
||||
CEF_CTBT_DOWNLOAD,
|
||||
CEF_CTBT_SEND_TAB_TO_SELF,
|
||||
CEF_CTBT_SIDE_PANEL,
|
||||
CEF_CTBT_MAX_VALUE = CEF_CTBT_SIDE_PANEL,
|
||||
} cef_chrome_toolbar_button_type_t;
|
||||
|
||||
///
|
||||
/// Docking modes supported by CefWindow::AddOverlay.
|
||||
///
|
||||
|
@@ -130,11 +130,11 @@ class CefWindowDelegate : public CefPanelDelegate {
|
||||
|
||||
///
|
||||
/// Return true if |window| should be created with standard window buttons
|
||||
/// like close, minimize and zoom.
|
||||
/// like close, minimize and zoom. This method is only supported on macOS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual bool WithStandardWindowButtons(CefRefPtr<CefWindow> window) {
|
||||
return false;
|
||||
return !IsFrameless(window);
|
||||
}
|
||||
|
||||
///
|
||||
@@ -196,6 +196,16 @@ class CefWindowDelegate : public CefPanelDelegate {
|
||||
const CefKeyEvent& event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
///
|
||||
/// Called when the |window| is transitioning to or from fullscreen mode. The
|
||||
/// transition occurs in two stages, with |is_competed| set to false when the
|
||||
/// transition starts and true when the transition completes.
|
||||
/// This method is only supported on macOS.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
|
||||
bool is_completed) {}
|
||||
};
|
||||
|
||||
#endif // CEF_INCLUDE_VIEWS_CEF_WINDOW_DELEGATE_H_
|
||||
|
@@ -29,6 +29,7 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/media/router/chrome_media_router_factory.h"
|
||||
#include "chrome/browser/net/system_network_context_manager.h"
|
||||
#include "chrome/browser/ui/color/chrome_color_mixers.h"
|
||||
#include "chrome/browser/ui/javascript_dialogs/chrome_javascript_app_modal_dialog_view_factory.h"
|
||||
#include "chrome/browser/ui/ui_features.h"
|
||||
#include "chrome/common/chrome_switches.h"
|
||||
@@ -187,6 +188,11 @@ void AlloyBrowserMainParts::ToolkitInitialized() {
|
||||
#else
|
||||
InstallChromeJavaScriptAppModalDialogViewFactory();
|
||||
#endif
|
||||
|
||||
// On GTK that builds the native theme that, in turn, adds the GTK core color
|
||||
// mixer; core mixers should all be added before we add chrome mixers.
|
||||
ui::ColorProviderManager::Get().AppendColorProviderInitializer(
|
||||
base::BindRepeating(AddChromeColorMixers));
|
||||
}
|
||||
|
||||
void AlloyBrowserMainParts::PreCreateMainMessageLoop() {
|
||||
|
@@ -9,6 +9,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "chrome/browser/ui/page_action/page_action_icon_type.h"
|
||||
#include "content/public/browser/web_contents_delegate.h"
|
||||
#include "ui/base/window_open_disposition.h"
|
||||
|
||||
@@ -65,6 +66,32 @@ class BrowserDelegate : public content::WebContentsDelegate {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Return true if the app menu item should be visible. ID values come from
|
||||
// chrome/app/chrome_command_ids.h.
|
||||
virtual bool IsAppMenuItemVisible(int command_id) { return true; }
|
||||
|
||||
// Return true if the app menu item should be enabled. ID values come from
|
||||
// chrome/app/chrome_command_ids.h.
|
||||
virtual bool IsAppMenuItemEnabled(int command_id) { return true; }
|
||||
|
||||
// Return true if the page action icon should be visible.
|
||||
virtual bool IsPageActionIconVisible(PageActionIconType icon_type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
enum class ToolbarButtonType {
|
||||
kCast = 0,
|
||||
kDownload,
|
||||
kSendTabToSelf,
|
||||
kSidePanel,
|
||||
kMaxValue = kSidePanel,
|
||||
};
|
||||
|
||||
// Return true if the toolbar button should be visible.
|
||||
virtual bool IsToolbarButtonVisible(ToolbarButtonType button_type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Same as RequestMediaAccessPermission but returning |callback| if the
|
||||
// request is unhandled.
|
||||
[[nodiscard]] virtual content::MediaResponseCallback
|
||||
|
@@ -122,6 +122,60 @@ bool ChromeBrowserDelegate::HandleCommand(int command_id,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::IsAppMenuItemVisible(int command_id) {
|
||||
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
|
||||
if (auto client = browser->GetClient()) {
|
||||
if (auto handler = client->GetCommandHandler()) {
|
||||
return handler->IsChromeAppMenuItemVisible(browser.get(), command_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::IsAppMenuItemEnabled(int command_id) {
|
||||
if (auto browser = ChromeBrowserHostImpl::GetBrowserForBrowser(browser_)) {
|
||||
if (auto client = browser->GetClient()) {
|
||||
if (auto handler = client->GetCommandHandler()) {
|
||||
return handler->IsChromeAppMenuItemEnabled(browser.get(), command_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::IsPageActionIconVisible(
|
||||
PageActionIconType icon_type) {
|
||||
// Verify that our enum matches Chromium's values.
|
||||
static_assert(static_cast<int>(CEF_CPAIT_MAX_VALUE) ==
|
||||
static_cast<int>(PageActionIconType::kMaxValue),
|
||||
"enum mismatch");
|
||||
|
||||
if (auto client = create_params_.client) {
|
||||
if (auto handler = client->GetCommandHandler()) {
|
||||
return handler->IsChromePageActionIconVisible(
|
||||
static_cast<cef_chrome_page_action_icon_type_t>(icon_type));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ChromeBrowserDelegate::IsToolbarButtonVisible(
|
||||
ToolbarButtonType button_type) {
|
||||
// Verify that our enum matches BrowserDelegate's values.
|
||||
static_assert(static_cast<int>(CEF_CTBT_MAX_VALUE) ==
|
||||
static_cast<int>(ToolbarButtonType::kMaxValue),
|
||||
"enum mismatch");
|
||||
|
||||
if (auto client = create_params_.client) {
|
||||
if (auto handler = client->GetCommandHandler()) {
|
||||
return handler->IsChromeToolbarButtonVisible(
|
||||
static_cast<cef_chrome_toolbar_button_type_t>(button_type));
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
content::MediaResponseCallback
|
||||
ChromeBrowserDelegate::RequestMediaAccessPermissionEx(
|
||||
content::WebContents* web_contents,
|
||||
|
@@ -56,6 +56,10 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
|
||||
bool ShowStatusBubble(bool show_by_default) override;
|
||||
bool HandleCommand(int command_id,
|
||||
WindowOpenDisposition disposition) override;
|
||||
bool IsAppMenuItemVisible(int command_id) override;
|
||||
bool IsAppMenuItemEnabled(int command_id) override;
|
||||
bool IsPageActionIconVisible(PageActionIconType icon_type) override;
|
||||
bool IsToolbarButtonVisible(ToolbarButtonType button_type) override;
|
||||
[[nodiscard]] content::MediaResponseCallback RequestMediaAccessPermissionEx(
|
||||
content::WebContents* web_contents,
|
||||
const content::MediaStreamRequest& request,
|
||||
|
@@ -20,6 +20,7 @@
|
||||
#include "chrome/browser/ui/browser_tabstrip.h"
|
||||
#include "chrome/browser/ui/browser_window.h"
|
||||
#include "chrome/browser/ui/tabs/tab_strip_model.h"
|
||||
#include "chrome/browser/ui/views/frame/contents_web_view.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "libcef/browser/chrome/views/chrome_browser_frame.h"
|
||||
#include "libcef/browser/chrome/views/chrome_browser_view.h"
|
||||
@@ -435,6 +436,9 @@ Browser* ChromeBrowserHostImpl::CreateBrowser(
|
||||
chrome_browser_view->InitBrowser(base::WrapUnique(browser),
|
||||
params.browser_view);
|
||||
|
||||
// Don't set theme colors in ContentsWebView::UpdateBackgroundColor.
|
||||
chrome_browser_view->contents_web_view()->SetBackgroundVisible(false);
|
||||
|
||||
// Don't show the browser by default.
|
||||
show_browser = false;
|
||||
}
|
||||
|
@@ -394,6 +394,7 @@ bool CefMainRunner::ContentMainRun(bool* initialized,
|
||||
|
||||
if (!CreateUIThread(base::BindOnce(
|
||||
[](CefMainRunner* runner, base::WaitableEvent* event) {
|
||||
runner->main_delegate_->BeforeUIThreadInitialize();
|
||||
content::ContentMainRun(runner->main_runner_.get());
|
||||
event->Signal();
|
||||
},
|
||||
@@ -408,6 +409,7 @@ bool CefMainRunner::ContentMainRun(bool* initialized,
|
||||
uithread_startup_event.Wait();
|
||||
} else {
|
||||
*initialized = true;
|
||||
main_delegate_->BeforeUIThreadInitialize();
|
||||
content::ContentMainRun(main_runner_.get());
|
||||
}
|
||||
|
||||
|
@@ -314,7 +314,7 @@ bool OnExtensionsSupportUI(std::string* mime_type, std::string* output) {
|
||||
"<html>\n<head><title>Extensions Support</title></head>\n"
|
||||
"<body bgcolor=\"white\"><h3>Supported Chrome Extensions "
|
||||
"APIs</h3>\nFollow <a "
|
||||
"href=\"https://bitbucket.org/chromiumembedded/cef/issues/1947\" "
|
||||
"href=\"https://github.com/chromiumembedded/cef/issues/1947\" "
|
||||
"target=\"new\">issue #1947</a> for development progress.\n<ul>\n";
|
||||
|
||||
bool has_top_level_name = false;
|
||||
|
@@ -1543,7 +1543,7 @@ void CefRenderWidgetHostViewOSR::OnPaint(const gfx::Rect& damage_rect,
|
||||
const void* pixels) {
|
||||
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::OnPaint");
|
||||
|
||||
// Workaround for https://bitbucket.org/chromiumembedded/cef/issues/2817
|
||||
// Workaround for https://github.com/chromiumembedded/cef/issues/2817
|
||||
if (!is_showing_) {
|
||||
return;
|
||||
}
|
||||
|
@@ -6,15 +6,18 @@
|
||||
#define CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_
|
||||
#pragma once
|
||||
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "include/internal/cef_ptr.h"
|
||||
|
||||
#include "ui/views/widget/native_widget_mac.h"
|
||||
|
||||
class CefWindow;
|
||||
class CefWindowDelegate;
|
||||
|
||||
class CefNativeWidgetMac : public views::NativeWidgetMac {
|
||||
public:
|
||||
CefNativeWidgetMac(views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height);
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate);
|
||||
~CefNativeWidgetMac() override = default;
|
||||
|
||||
CefNativeWidgetMac(const CefNativeWidgetMac&) = delete;
|
||||
@@ -27,11 +30,12 @@ class CefNativeWidgetMac : public views::NativeWidgetMac {
|
||||
|
||||
void GetWindowFrameTitlebarHeight(bool* override_titlebar_height,
|
||||
float* titlebar_height) override;
|
||||
void OnWindowFullscreenTransitionStart() override;
|
||||
void OnWindowFullscreenTransitionComplete() override;
|
||||
|
||||
private:
|
||||
const bool is_frameless_;
|
||||
const bool with_window_buttons_;
|
||||
const absl::optional<float> title_bar_height_;
|
||||
const CefRefPtr<CefWindow> window_;
|
||||
CefWindowDelegate* const window_delegate_;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_BROWSER_VIEWS_NATIVE_WIDGET_MAC_H_
|
||||
|
@@ -4,17 +4,17 @@
|
||||
|
||||
#include "libcef/browser/views/native_widget_mac.h"
|
||||
|
||||
#include "include/views/cef_window.h"
|
||||
#include "include/views/cef_window_delegate.h"
|
||||
#include "libcef/browser/views/ns_window.h"
|
||||
|
||||
CefNativeWidgetMac::CefNativeWidgetMac(
|
||||
views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height)
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate)
|
||||
: views::NativeWidgetMac(delegate),
|
||||
is_frameless_(is_frameless),
|
||||
with_window_buttons_(with_window_buttons),
|
||||
title_bar_height_(title_bar_height) {}
|
||||
window_(window),
|
||||
window_delegate_(window_delegate) {}
|
||||
|
||||
NativeWidgetMacNSWindow* CefNativeWidgetMac::CreateNSWindow(
|
||||
const remote_cocoa::mojom::CreateWindowParams* params) {
|
||||
@@ -22,15 +22,18 @@ NativeWidgetMacNSWindow* CefNativeWidgetMac::CreateNSWindow(
|
||||
NSWindowStyleMaskTitled | NSWindowStyleMaskMiniaturizable |
|
||||
NSWindowStyleMaskClosable | NSWindowStyleMaskResizable |
|
||||
NSWindowStyleMaskTexturedBackground;
|
||||
auto window = [[CefNSWindow alloc] initWithStyle:style_mask
|
||||
isFrameless:is_frameless_];
|
||||
|
||||
if (is_frameless_) {
|
||||
bool is_frameless = window_delegate_->IsFrameless(window_);
|
||||
|
||||
auto window = [[CefNSWindow alloc] initWithStyle:style_mask
|
||||
isFrameless:is_frameless];
|
||||
|
||||
if (is_frameless) {
|
||||
[window setTitlebarAppearsTransparent:YES];
|
||||
[window setTitleVisibility:NSWindowTitleHidden];
|
||||
}
|
||||
|
||||
if (!with_window_buttons_) {
|
||||
if (!window_delegate_->WithStandardWindowButtons(window_)) {
|
||||
[[window standardWindowButton:NSWindowCloseButton] setHidden:YES];
|
||||
[[window standardWindowButton:NSWindowMiniaturizeButton] setHidden:YES];
|
||||
[[window standardWindowButton:NSWindowZoomButton] setHidden:YES];
|
||||
@@ -42,11 +45,20 @@ NativeWidgetMacNSWindow* CefNativeWidgetMac::CreateNSWindow(
|
||||
void CefNativeWidgetMac::GetWindowFrameTitlebarHeight(
|
||||
bool* override_titlebar_height,
|
||||
float* titlebar_height) {
|
||||
if (title_bar_height_) {
|
||||
if (window_delegate_->GetTitlebarHeight(window_, titlebar_height)) {
|
||||
*override_titlebar_height = true;
|
||||
*titlebar_height = title_bar_height_.value();
|
||||
} else {
|
||||
views::NativeWidgetMac::GetWindowFrameTitlebarHeight(
|
||||
override_titlebar_height, titlebar_height);
|
||||
}
|
||||
}
|
||||
|
||||
void CefNativeWidgetMac::OnWindowFullscreenTransitionStart() {
|
||||
views::NativeWidgetMac::OnWindowFullscreenTransitionStart();
|
||||
window_delegate_->OnWindowFullscreenTransition(window_, false);
|
||||
}
|
||||
|
||||
void CefNativeWidgetMac::OnWindowFullscreenTransitionComplete() {
|
||||
views::NativeWidgetMac::OnWindowFullscreenTransitionComplete();
|
||||
window_delegate_->OnWindowFullscreenTransition(window_, true);
|
||||
}
|
||||
|
@@ -9,7 +9,6 @@
|
||||
#include "include/views/cef_view.h"
|
||||
#include "include/views/cef_window.h"
|
||||
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gfx/native_widget_types.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
@@ -29,6 +28,8 @@ class NativeWidgetDelegate;
|
||||
}
|
||||
} // namespace views
|
||||
|
||||
class CefWindowDelegate;
|
||||
|
||||
#define CEF_REQUIRE_VALID_RETURN(ret) \
|
||||
if (!ParentClass::IsValid()) \
|
||||
return ret;
|
||||
@@ -148,9 +149,8 @@ CefWindowHandle GetWindowHandle(gfx::NativeWindow window);
|
||||
|
||||
views::NativeWidget* CreateNativeWidget(
|
||||
views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height);
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate);
|
||||
|
||||
} // namespace view_util
|
||||
|
||||
|
@@ -44,9 +44,8 @@ CefWindowHandle GetWindowHandle(gfx::NativeWindow window) {
|
||||
|
||||
views::NativeWidget* CreateNativeWidget(
|
||||
views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height) {
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@@ -47,10 +47,8 @@ CefWindowHandle GetWindowHandle(gfx::NativeWindow window) {
|
||||
|
||||
views::NativeWidget* CreateNativeWidget(
|
||||
views::internal::NativeWidgetDelegate* delegate,
|
||||
bool is_frameless,
|
||||
bool with_window_buttons,
|
||||
absl::optional<float> title_bar_height) {
|
||||
return new CefNativeWidgetMac(delegate, is_frameless, with_window_buttons,
|
||||
title_bar_height);
|
||||
CefRefPtr<CefWindow> window,
|
||||
CefWindowDelegate* window_delegate) {
|
||||
return new CefNativeWidgetMac(delegate, window, window_delegate);
|
||||
}
|
||||
} // namespace view_util
|
||||
|
@@ -313,13 +313,8 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
|
||||
} else {
|
||||
is_frameless_ = cef_delegate()->IsFrameless(cef_window);
|
||||
|
||||
const bool with_standard_buttons =
|
||||
cef_delegate()->WithStandardWindowButtons(cef_window);
|
||||
|
||||
const auto title_bar_height = GetTitlebarHeight(cef_window);
|
||||
|
||||
params.native_widget = view_util::CreateNativeWidget(
|
||||
widget, is_frameless_, with_standard_buttons, title_bar_height);
|
||||
params.native_widget =
|
||||
view_util::CreateNativeWidget(widget, cef_window, cef_delegate());
|
||||
|
||||
can_resize = cef_delegate()->CanResize(cef_window);
|
||||
|
||||
@@ -666,14 +661,3 @@ views::NonClientFrameView* CefWindowView::GetNonClientFrameView() const {
|
||||
}
|
||||
return widget->non_client_view()->frame_view();
|
||||
}
|
||||
|
||||
absl::optional<float> CefWindowView::GetTitlebarHeight(
|
||||
const CefRefPtr<CefWindow>& window) const {
|
||||
float title_bar_height = 0;
|
||||
const bool has_title_bar_height =
|
||||
cef_delegate()->GetTitlebarHeight(window, &title_bar_height);
|
||||
if (has_title_bar_height) {
|
||||
return title_bar_height;
|
||||
}
|
||||
return absl::nullopt;
|
||||
}
|
@@ -14,7 +14,6 @@
|
||||
#include "libcef/browser/views/overlay_view_host.h"
|
||||
#include "libcef/browser/views/panel_view.h"
|
||||
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/skia/include/core/SkRegion.h"
|
||||
#include "ui/display/display.h"
|
||||
#include "ui/views/widget/widget_delegate.h"
|
||||
@@ -120,9 +119,6 @@ class CefWindowView
|
||||
|
||||
void MoveOverlaysIfNecessary();
|
||||
|
||||
absl::optional<float> GetTitlebarHeight(
|
||||
const CefRefPtr<CefWindow>& window) const;
|
||||
|
||||
// Not owned by this object.
|
||||
Delegate* window_delegate_;
|
||||
|
||||
|
@@ -40,8 +40,6 @@ void ChromeMainRunnerDelegate::BeforeMainThreadInitialize(
|
||||
#else
|
||||
base::CommandLine::Init(args.argc, args.argv);
|
||||
#endif
|
||||
|
||||
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
|
||||
}
|
||||
|
||||
void ChromeMainRunnerDelegate::BeforeMainMessageLoopRun(
|
||||
@@ -70,14 +68,16 @@ bool ChromeMainRunnerDelegate::HandleMainMessageLoopQuit() {
|
||||
return true;
|
||||
}
|
||||
|
||||
void ChromeMainRunnerDelegate::BeforeUIThreadInitialize() {
|
||||
sampling_profiler_ = std::make_unique<MainThreadStackSamplingProfiler>();
|
||||
}
|
||||
|
||||
void ChromeMainRunnerDelegate::AfterUIThreadShutdown() {
|
||||
static_cast<ChromeContentBrowserClient*>(
|
||||
CefAppManager::Get()->GetContentClient()->browser())
|
||||
->CleanupOnUIThread();
|
||||
main_delegate_->CleanupOnUIThread();
|
||||
}
|
||||
|
||||
void ChromeMainRunnerDelegate::AfterMainThreadShutdown() {
|
||||
sampling_profiler_.reset();
|
||||
}
|
||||
|
||||
|
@@ -35,8 +35,8 @@ class ChromeMainRunnerDelegate : public CefMainRunnerDelegate {
|
||||
void BeforeMainThreadInitialize(const CefMainArgs& args) override;
|
||||
void BeforeMainMessageLoopRun(base::RunLoop* run_loop) override;
|
||||
bool HandleMainMessageLoopQuit() override;
|
||||
void BeforeUIThreadInitialize() override;
|
||||
void AfterUIThreadShutdown() override;
|
||||
void AfterMainThreadShutdown() override;
|
||||
void BeforeExecuteProcess(const CefMainArgs& args) override;
|
||||
void AfterExecuteProcess() override;
|
||||
|
||||
|
@@ -24,6 +24,7 @@ class CefMainRunnerDelegate {
|
||||
virtual void BeforeMainThreadRun() {}
|
||||
virtual void BeforeMainMessageLoopRun(base::RunLoop* run_loop) {}
|
||||
virtual bool HandleMainMessageLoopQuit() { return false; }
|
||||
virtual void BeforeUIThreadInitialize() {}
|
||||
virtual void AfterUIThreadInitialize() {}
|
||||
virtual void AfterUIThreadShutdown() {}
|
||||
virtual void BeforeMainThreadShutdown() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=bf815bb565ccf2570c6f6b881009fe7df20805f0$
|
||||
// $hash=7b58140cd5e363a79adf4e420ceae009a7d10811$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/command_handler_cpptoc.h"
|
||||
@@ -47,12 +47,114 @@ command_handler_on_chrome_command(struct _cef_command_handler_t* self,
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK command_handler_is_chrome_app_menu_item_visible(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
int command_id) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self) {
|
||||
return 0;
|
||||
}
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Execute
|
||||
bool _retval = CefCommandHandlerCppToC::Get(self)->IsChromeAppMenuItemVisible(
|
||||
CefBrowserCToCpp::Wrap(browser), command_id);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK command_handler_is_chrome_app_menu_item_enabled(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
int command_id) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self) {
|
||||
return 0;
|
||||
}
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Execute
|
||||
bool _retval = CefCommandHandlerCppToC::Get(self)->IsChromeAppMenuItemEnabled(
|
||||
CefBrowserCToCpp::Wrap(browser), command_id);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK command_handler_is_chrome_page_action_icon_visible(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_chrome_page_action_icon_type_t icon_type) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Execute
|
||||
bool _retval =
|
||||
CefCommandHandlerCppToC::Get(self)->IsChromePageActionIconVisible(
|
||||
icon_type);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
int CEF_CALLBACK command_handler_is_chrome_toolbar_button_visible(
|
||||
struct _cef_command_handler_t* self,
|
||||
cef_chrome_toolbar_button_type_t button_type) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Execute
|
||||
bool _retval =
|
||||
CefCommandHandlerCppToC::Get(self)->IsChromeToolbarButtonVisible(
|
||||
button_type);
|
||||
|
||||
// Return type: bool
|
||||
return _retval;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefCommandHandlerCppToC::CefCommandHandlerCppToC() {
|
||||
GetStruct()->on_chrome_command = command_handler_on_chrome_command;
|
||||
GetStruct()->is_chrome_app_menu_item_visible =
|
||||
command_handler_is_chrome_app_menu_item_visible;
|
||||
GetStruct()->is_chrome_app_menu_item_enabled =
|
||||
command_handler_is_chrome_app_menu_item_enabled;
|
||||
GetStruct()->is_chrome_page_action_icon_visible =
|
||||
command_handler_is_chrome_page_action_icon_visible;
|
||||
GetStruct()->is_chrome_toolbar_button_visible =
|
||||
command_handler_is_chrome_toolbar_button_visible;
|
||||
}
|
||||
|
||||
// DESTRUCTOR - Do not edit by hand.
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=18f715de465689a4e8484bbced8ad92d9434438a$
|
||||
// $hash=c7e5e137df27a4986c13e6f4e2b98eac19a48193$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/views/window_delegate_cpptoc.h"
|
||||
@@ -484,6 +484,29 @@ window_delegate_on_key_event(struct _cef_window_delegate_t* self,
|
||||
return _retval;
|
||||
}
|
||||
|
||||
void CEF_CALLBACK window_delegate_on_window_fullscreen_transition(
|
||||
struct _cef_window_delegate_t* self,
|
||||
cef_window_t* window,
|
||||
int is_completed) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self) {
|
||||
return;
|
||||
}
|
||||
// Verify param: window; type: refptr_diff
|
||||
DCHECK(window);
|
||||
if (!window) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
CefWindowDelegateCppToC::Get(self)->OnWindowFullscreenTransition(
|
||||
CefWindowCToCpp::Wrap(window), is_completed ? true : false);
|
||||
}
|
||||
|
||||
cef_size_t CEF_CALLBACK
|
||||
window_delegate_get_preferred_size(struct _cef_view_delegate_t* self,
|
||||
cef_view_t* view) {
|
||||
@@ -770,6 +793,8 @@ CefWindowDelegateCppToC::CefWindowDelegateCppToC() {
|
||||
GetStruct()->can_close = window_delegate_can_close;
|
||||
GetStruct()->on_accelerator = window_delegate_on_accelerator;
|
||||
GetStruct()->on_key_event = window_delegate_on_key_event;
|
||||
GetStruct()->on_window_fullscreen_transition =
|
||||
window_delegate_on_window_fullscreen_transition;
|
||||
GetStruct()->base.base.get_preferred_size =
|
||||
window_delegate_get_preferred_size;
|
||||
GetStruct()->base.base.get_minimum_size = window_delegate_get_minimum_size;
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=af3697f4c41762086c8edff7f63a794e8bf95b25$
|
||||
// $hash=f374fda38406905546bc5601c01764a9b437a7d0$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/command_handler_ctocpp.h"
|
||||
@@ -46,6 +46,98 @@ bool CefCommandHandlerCToCpp::OnChromeCommand(
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefCommandHandlerCToCpp::IsChromeAppMenuItemVisible(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
int command_id) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_command_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_chrome_app_menu_item_visible)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_chrome_app_menu_item_visible(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), command_id);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefCommandHandlerCToCpp::IsChromeAppMenuItemEnabled(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
int command_id) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_command_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_chrome_app_menu_item_enabled)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser.get());
|
||||
if (!browser.get()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_chrome_app_menu_item_enabled(
|
||||
_struct, CefBrowserCppToC::Wrap(browser), command_id);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefCommandHandlerCToCpp::IsChromePageActionIconVisible(
|
||||
cef_chrome_page_action_icon_type_t icon_type) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_command_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_chrome_page_action_icon_visible)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_chrome_page_action_icon_visible(_struct, icon_type);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
bool CefCommandHandlerCToCpp::IsChromeToolbarButtonVisible(
|
||||
cef_chrome_toolbar_button_type_t button_type) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_command_handler_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, is_chrome_toolbar_button_visible)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Execute
|
||||
int _retval = _struct->is_chrome_toolbar_button_visible(_struct, button_type);
|
||||
|
||||
// Return type: bool
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefCommandHandlerCToCpp::CefCommandHandlerCToCpp() {}
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=1def18706fb8efd9d28a718b505905d366a0d057$
|
||||
// $hash=ad0096887a1662a2cc3804248365e56fc20d6eaa$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_COMMAND_HANDLER_CTOCPP_H_
|
||||
@@ -38,6 +38,14 @@ class CefCommandHandlerCToCpp
|
||||
bool OnChromeCommand(CefRefPtr<CefBrowser> browser,
|
||||
int command_id,
|
||||
cef_window_open_disposition_t disposition) override;
|
||||
bool IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) override;
|
||||
bool IsChromeAppMenuItemEnabled(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) override;
|
||||
bool IsChromePageActionIconVisible(
|
||||
cef_chrome_page_action_icon_type_t icon_type) override;
|
||||
bool IsChromeToolbarButtonVisible(
|
||||
cef_chrome_toolbar_button_type_t button_type) override;
|
||||
};
|
||||
|
||||
#endif // CEF_LIBCEF_DLL_CTOCPP_COMMAND_HANDLER_CTOCPP_H_
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=40aea12873a3c8803c9d2d6c06a0270197ead58e$
|
||||
// $hash=5d3fd8439bbc051bac61497b125a7ac35859881d$
|
||||
//
|
||||
|
||||
#include "libcef_dll/ctocpp/views/window_delegate_ctocpp.h"
|
||||
@@ -462,6 +462,30 @@ bool CefWindowDelegateCToCpp::OnKeyEvent(CefRefPtr<CefWindow> window,
|
||||
return _retval ? true : false;
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
void CefWindowDelegateCToCpp::OnWindowFullscreenTransition(
|
||||
CefRefPtr<CefWindow> window,
|
||||
bool is_completed) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
||||
cef_window_delegate_t* _struct = GetStruct();
|
||||
if (CEF_MEMBER_MISSING(_struct, on_window_fullscreen_transition)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
// Verify param: window; type: refptr_diff
|
||||
DCHECK(window.get());
|
||||
if (!window.get()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Execute
|
||||
_struct->on_window_fullscreen_transition(
|
||||
_struct, CefWindowCppToC::Wrap(window), is_completed);
|
||||
}
|
||||
|
||||
NO_SANITIZE("cfi-icall")
|
||||
CefSize CefWindowDelegateCToCpp::GetPreferredSize(CefRefPtr<CefView> view) {
|
||||
shutdown_checker::AssertNotShutdown();
|
||||
|
@@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=d100d8866a7eab2a163d4ddb3cacd00141f65757$
|
||||
// $hash=bf87c473a5bafd3f8c30bd06c033b0182f65a7b7$
|
||||
//
|
||||
|
||||
#ifndef CEF_LIBCEF_DLL_CTOCPP_VIEWS_WINDOW_DELEGATE_CTOCPP_H_
|
||||
@@ -60,6 +60,8 @@ class CefWindowDelegateCToCpp
|
||||
bool OnAccelerator(CefRefPtr<CefWindow> window, int command_id) override;
|
||||
bool OnKeyEvent(CefRefPtr<CefWindow> window,
|
||||
const CefKeyEvent& event) override;
|
||||
void OnWindowFullscreenTransition(CefRefPtr<CefWindow> window,
|
||||
bool is_completed) override;
|
||||
|
||||
// CefPanelDelegate methods.
|
||||
|
||||
|
153
patch/patch.cfg
153
patch/patch.cfg
@@ -30,7 +30,7 @@ patches = [
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=634788
|
||||
#
|
||||
# Windows: Add cc_wrapper support for sccache builds.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2432
|
||||
# https://github.com/chromiumembedded/cef/issues/2432
|
||||
#
|
||||
# Windows: Add GN arg windows_sdk_version.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1420723
|
||||
@@ -46,7 +46,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Support component builds (GN is_component_build=true).
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1617
|
||||
# https://github.com/chromiumembedded/cef/issues/1617
|
||||
'name': 'component_build',
|
||||
},
|
||||
{
|
||||
@@ -58,7 +58,7 @@ patches = [
|
||||
#
|
||||
# Add MessageLoop::ReleasePump to fix crashes during shutdown with multi-
|
||||
# threaded message loop mode.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2362
|
||||
# https://github.com/chromiumembedded/cef/issues/2362
|
||||
'name': 'message_loop',
|
||||
},
|
||||
{
|
||||
@@ -77,27 +77,27 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Fix export of UnderlayOpenGLHostingWindow for 64-bit MacOS builds.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1051
|
||||
# https://github.com/chromiumembedded/cef/issues/1051
|
||||
'name': 'underlay_1051',
|
||||
},
|
||||
{
|
||||
# Allow specification of a parent window handle for Widget creation.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/180
|
||||
# https://github.com/chromiumembedded/cef/issues/180
|
||||
#
|
||||
# Fix multiple handling of WM_MOUSEWHEEL messages on Windows.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1481
|
||||
# https://github.com/chromiumembedded/cef/issues/1481
|
||||
#
|
||||
# Support custom RenderWidgetHostViewOSR for BrowserPluginGuest.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1565
|
||||
# https://github.com/chromiumembedded/cef/issues/1565
|
||||
#
|
||||
# Fix focus/activation handling and keyboard input on Windows and Linux.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1677
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1679
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1700
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3316
|
||||
# https://github.com/chromiumembedded/cef/issues/1677
|
||||
# https://github.com/chromiumembedded/cef/issues/1679
|
||||
# https://github.com/chromiumembedded/cef/issues/1700
|
||||
# https://github.com/chromiumembedded/cef/issues/3316
|
||||
#
|
||||
# Support creation of captionless windows with resizable borders.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1749
|
||||
# https://github.com/chromiumembedded/cef/issues/1749
|
||||
#
|
||||
# Windows: When |params.remove_standard_frame| is true remove WS_CAPTION
|
||||
# and WS_SYSMENU styles. Otherwise Windows 10 enforces a minimum window
|
||||
@@ -105,13 +105,13 @@ patches = [
|
||||
# Linux: Allow creation of activatable menu windows.
|
||||
# Linux: Support CefWindowDelegate::CanResize restriction by specifying
|
||||
# min/max Widget size values.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1947
|
||||
# https://github.com/chromiumembedded/cef/issues/1947
|
||||
#
|
||||
# Support configuration of RWHVGuest device scale factor.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2078
|
||||
# https://github.com/chromiumembedded/cef/issues/2078
|
||||
#
|
||||
# Windows: Fix focus assignment when clicking WebView with external parent.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3031
|
||||
# https://github.com/chromiumembedded/cef/issues/3031
|
||||
#
|
||||
# Fix minimize & fullscreen behavior on initial Widget creation.
|
||||
#
|
||||
@@ -121,27 +121,27 @@ patches = [
|
||||
#
|
||||
# Windows: Fix incorrect DIPToScreenRect usage in DesktopWindowTreeHostWin
|
||||
# when |has_external_parent_| is true.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3359
|
||||
# https://github.com/chromiumembedded/cef/issues/3359
|
||||
'name': 'views_widget',
|
||||
},
|
||||
{
|
||||
# Allow specification of a custom WebContentsView.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1257
|
||||
# https://github.com/chromiumembedded/cef/issues/1257
|
||||
#
|
||||
# Support custom RenderWidgetHostViewOSR for BrowserPluginGuest.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1565
|
||||
# https://github.com/chromiumembedded/cef/issues/1565
|
||||
#
|
||||
# Add WebContentsObserver::OnFrameFocused.
|
||||
#
|
||||
# Add WebContentsObserver::RenderWidgetCreated.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3308
|
||||
# https://github.com/chromiumembedded/cef/issues/3308
|
||||
'name': 'web_contents_1257_1565',
|
||||
},
|
||||
{
|
||||
# Support custom RenderWidgetHostViewOSR for MimeHandlerViewGuest and
|
||||
# expose OnGuestAttached/Detached notifications.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1565
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2727
|
||||
# https://github.com/chromiumembedded/cef/issues/1565
|
||||
# https://github.com/chromiumembedded/cef/issues/2727
|
||||
'name': 'mime_handler_view_guest_1565_2727',
|
||||
},
|
||||
{
|
||||
@@ -154,21 +154,21 @@ patches = [
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=654986#c17
|
||||
#
|
||||
# Remove DCHECK on Linux when initialized CEF from a non-main thread.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issue/1639
|
||||
# https://github.com/chromiumembedded/cef/issues/1639
|
||||
#
|
||||
# Fix DiscardableSharedMemoryManager crash on shutdown with multi-threaded
|
||||
# message loop.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2798
|
||||
# https://github.com/chromiumembedded/cef/issues/2798
|
||||
'name': 'content_main_654986',
|
||||
},
|
||||
{
|
||||
# Expose the FontFamilyCache UserData key.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1501
|
||||
# https://github.com/chromiumembedded/cef/issues/1501
|
||||
'name': 'font_family_cache_1501',
|
||||
},
|
||||
{
|
||||
# Modify views::View to extend SupportsUserData.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1749
|
||||
# https://github.com/chromiumembedded/cef/issues/1749
|
||||
#
|
||||
# Don't add TestDesktopScreenOzone dependency on Linux.
|
||||
# Reverts ui_controls_factory_desktop_aurax11.cc (now
|
||||
@@ -185,10 +185,10 @@ patches = [
|
||||
#
|
||||
# Expose callbacks for mouse/keyboard events that trigger menu switching.
|
||||
# Add accelerator display support to Label.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2102
|
||||
# https://github.com/chromiumembedded/cef/issues/2102
|
||||
#
|
||||
# Route |parent_widget| to MenuHost for OSR context menu Widget creation.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3330
|
||||
# https://github.com/chromiumembedded/cef/issues/3330
|
||||
'name': 'views_1749_2102_3330',
|
||||
},
|
||||
{
|
||||
@@ -204,19 +204,19 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Changes to support the Chrome runtime in CEF.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_runtime',
|
||||
},
|
||||
{
|
||||
# Changes to support Chrome runtime integration with CEF Views.
|
||||
# See related documentation in
|
||||
# libcef/browser/chrome/views/chrome_browser_frame.h.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_runtime_views',
|
||||
},
|
||||
{
|
||||
# Changes to support the Chrome runtime in CEF.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
#
|
||||
# Fix fatal error: 'components/printing/common/print.mojom.h' file not found
|
||||
# From chrome/browser/ui/browser_commands.cc via
|
||||
@@ -225,7 +225,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Don't initialize ExtensionSystemFactory when extensions are disabled.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2359
|
||||
# https://github.com/chromiumembedded/cef/issues/2359
|
||||
#
|
||||
# Remove NOTREACHED() in GetContentSettingFromRulesImpl triggered by
|
||||
# NavigationTest.LoadCrossOriginLoadURL with the chrome runtime.
|
||||
@@ -233,7 +233,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# chrome: Support custom handling of context menus.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_context_menus',
|
||||
},
|
||||
{
|
||||
@@ -241,7 +241,7 @@ patches = [
|
||||
# - Adds support for FileSelectHelper and SelectFileDialog interception.
|
||||
# - Adds additional type filters for dialogs created via FileSelectHelper.
|
||||
# - Adds support for chaining PrintingContextLinux callbacks.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3314
|
||||
# https://github.com/chromiumembedded/cef/issues/3314
|
||||
'name': 'chrome_browser_dialogs_native',
|
||||
},
|
||||
{
|
||||
@@ -250,44 +250,44 @@ patches = [
|
||||
# DialogDelegate::CreateDialogWidget for CEF windowless rendering.
|
||||
# - Support nullptr gfx::NativeWindow/gfx::NativeView dialog parent for CEF
|
||||
# windowless rendering.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3316
|
||||
# https://github.com/chromiumembedded/cef/issues/3316
|
||||
'name': 'chrome_browser_dialogs_widget',
|
||||
},
|
||||
{
|
||||
# chrome: Support override of ChromeMimeHandlerViewGuestDelegate.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_extensions',
|
||||
},
|
||||
{
|
||||
# alloy: Disable ProxyErrorClient callbacks when extensions are disabled.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2830
|
||||
# https://github.com/chromiumembedded/cef/issues/2830
|
||||
'name': 'chrome_browser_net_proxy',
|
||||
},
|
||||
{
|
||||
# Support override of CreatePermissionPrompt.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3352
|
||||
# https://github.com/chromiumembedded/cef/issues/3352
|
||||
'name': 'chrome_browser_permission_prompt',
|
||||
},
|
||||
{
|
||||
# alloy: Don't initialize ExtensionSystemFactory when extensions are
|
||||
# disabled.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2852
|
||||
# https://github.com/chromiumembedded/cef/issues/2852
|
||||
'name': 'chrome_browser_themes',
|
||||
},
|
||||
{
|
||||
# Make some methods of ProfileManager virtual.
|
||||
#
|
||||
# Don't create IdentityManager in RendererUpdater.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1917
|
||||
# https://github.com/chromiumembedded/cef/issues/1917
|
||||
#
|
||||
# chrome: Support CEF incognito Profiles that allow Browser creation.
|
||||
# chrome: Allow CEF to delay OffTheRecordProfileImpl initialization.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_profiles',
|
||||
},
|
||||
{
|
||||
# chrome: Fix assertion when clicking the incognito profile button.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_profile_menu',
|
||||
},
|
||||
{
|
||||
@@ -298,7 +298,7 @@ patches = [
|
||||
{
|
||||
# Support override of the User-Agent product component when NetworkService
|
||||
# is enabled.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2622
|
||||
# https://github.com/chromiumembedded/cef/issues/2622
|
||||
'name': 'embedder_product_override',
|
||||
},
|
||||
{
|
||||
@@ -314,17 +314,17 @@ patches = [
|
||||
{
|
||||
# Don't create databases, blob_storage or VideoDecodeStats directories when
|
||||
# cache_path is empty.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2289
|
||||
# https://github.com/chromiumembedded/cef/issues/2289
|
||||
'name': 'storage_incognito_2289',
|
||||
},
|
||||
{
|
||||
# Support WebUI by removing dependency on non-NULL IOThread* object.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2037
|
||||
# https://github.com/chromiumembedded/cef/issues/2037
|
||||
'name': 'webui_2037',
|
||||
},
|
||||
{
|
||||
# Implement breakpad/crashpad customization required by CEF.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1995
|
||||
# https://github.com/chromiumembedded/cef/issues/1995
|
||||
'name': 'crashpad_1995',
|
||||
},
|
||||
{
|
||||
@@ -337,7 +337,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Fix white flash during browser creation.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1984
|
||||
# https://github.com/chromiumembedded/cef/issues/1984
|
||||
#
|
||||
# Windows: Fix crash during window creation.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=761389
|
||||
@@ -354,15 +354,15 @@ patches = [
|
||||
# Add ContentRendererClient::DevToolsAgent[Attached|Detached] methods.
|
||||
#
|
||||
# Always return the Chrome product value for DevTools.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2300
|
||||
# https://github.com/chromiumembedded/cef/issues/2300
|
||||
#
|
||||
# Add new ContentBrowserClient::HandleExternalProtocol variant for use with
|
||||
# the NetworkService.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2622
|
||||
# https://github.com/chromiumembedded/cef/issues/2622
|
||||
#
|
||||
# Change ContentBrowserClient::ConfigureNetworkContextParams return type to
|
||||
# bool to support cancellation of NetworkContext creation during shutdown.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2985
|
||||
# https://github.com/chromiumembedded/cef/issues/2985
|
||||
'name': 'content_2015',
|
||||
},
|
||||
{
|
||||
@@ -371,18 +371,18 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Linux: Attach routing IDs to PrintingContext.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2196
|
||||
# https://github.com/chromiumembedded/cef/issues/2196
|
||||
'name': 'printing_context_2196',
|
||||
},
|
||||
{
|
||||
# Windows: Remove llvmlibthin as the combine_libs.py can't handle those.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2470
|
||||
# https://github.com/chromiumembedded/cef/issues/2470
|
||||
'name': 'build',
|
||||
},
|
||||
{
|
||||
# Changes necessary to support chrome extensions. Add a new
|
||||
# ExtensionHost constructor that allows CEF to create the WebContents.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1947
|
||||
# https://github.com/chromiumembedded/cef/issues/1947
|
||||
#
|
||||
# Don't initialize PrerenderContents object in StreamsPrivateAPI.
|
||||
#
|
||||
@@ -392,7 +392,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# macOS: Fix undesirable switch to discrete GPU during startup.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2398
|
||||
# https://github.com/chromiumembedded/cef/issues/2398
|
||||
#
|
||||
# macOS: Rely on symlinks to find the Libraries directory.
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=757974#c23
|
||||
@@ -400,28 +400,28 @@ patches = [
|
||||
},
|
||||
{
|
||||
# macOS: Make the NativeEventProcessor protocol dependency optional.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2539
|
||||
# https://github.com/chromiumembedded/cef/issues/2539
|
||||
'name': 'mac_event_observer_2539',
|
||||
},
|
||||
{
|
||||
# macOS: Fix crash when scrolling in OSR mode.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2540
|
||||
# https://github.com/chromiumembedded/cef/issues/2540
|
||||
'name': 'mac_fling_scheduler_2540',
|
||||
},
|
||||
{
|
||||
# Allow ResourceBundle creation/destruction on the main thread and usage on
|
||||
# the UI thread.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2398
|
||||
# https://github.com/chromiumembedded/cef/issues/2398
|
||||
'name': 'resource_bundle_2512',
|
||||
},
|
||||
{
|
||||
# macOS: Fix crash when showing a select popup with CefDoMessageLoopWork.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2495
|
||||
# https://github.com/chromiumembedded/cef/issues/2495
|
||||
'name': 'message_pump_mac_2495',
|
||||
},
|
||||
{
|
||||
# Linux: Load binaries from DIR_ASSETS.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1936
|
||||
# https://github.com/chromiumembedded/cef/issues/1936
|
||||
'name': 'linux_assets_path_1936',
|
||||
},
|
||||
{
|
||||
@@ -432,7 +432,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Linux: Avoid usage of chrome::FILE_COMPONENT_WIDEVINE_CDM_HINT.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3149
|
||||
# https://github.com/chromiumembedded/cef/issues/3149
|
||||
'name': 'linux_chrome_widevine_3149',
|
||||
},
|
||||
{
|
||||
@@ -440,21 +440,21 @@ patches = [
|
||||
# - Add support for calling CookieMonster::SetCookieableSchemes.
|
||||
# - Fix cache directory structure ("C:\temp\cache\cache\Cache" should be
|
||||
# "C:\temp\cache\Cache").
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2622
|
||||
# https://github.com/chromiumembedded/cef/issues/2622
|
||||
#
|
||||
# alloy: Avoid initialization of privacy sandbox and identity manager.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3434
|
||||
# https://github.com/chromiumembedded/cef/issues/3434
|
||||
'name': 'services_network_2622',
|
||||
},
|
||||
{
|
||||
# Enhancements to NetworkService:
|
||||
# - Remove the non-nullptr WebContents requirement from
|
||||
# NetworkServiceClient::OnAuthRequired.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2718
|
||||
# https://github.com/chromiumembedded/cef/issues/2718
|
||||
#
|
||||
# Change ContentBrowserClient::ConfigureNetworkContextParams return type to
|
||||
# bool to support cancellation of NetworkContext creation during shutdown.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2985
|
||||
# https://github.com/chromiumembedded/cef/issues/2985
|
||||
#
|
||||
# Compute correct default quota when cache_path is unspecified.
|
||||
'name': 'services_network_2718',
|
||||
@@ -498,7 +498,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Add support for OSR rendering with Viz.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2575
|
||||
# https://github.com/chromiumembedded/cef/issues/2575
|
||||
'name': 'viz_osr_2575',
|
||||
},
|
||||
{
|
||||
@@ -508,17 +508,17 @@ patches = [
|
||||
# - Remove unsupported print preview UI options.
|
||||
# - macOS: Fix error: no member named 'kCloudPrinterHandler' in namespace
|
||||
# 'printing::features',
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/123
|
||||
# https://github.com/chromiumembedded/cef/issues/123
|
||||
'name': 'print_preview_123',
|
||||
},
|
||||
{
|
||||
# Store command-line switch names as lower-case ASCII on all platforms.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/1872
|
||||
# https://github.com/chromiumembedded/cef/issues/1872
|
||||
'name': 'base_command_line_1872',
|
||||
},
|
||||
{
|
||||
# Remove cef_sandbox dependency on boringssl functions.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2743
|
||||
# https://github.com/chromiumembedded/cef/issues/2743
|
||||
#
|
||||
# Enable the VS 2015 Update 2 fix when building with the MSVC standard
|
||||
# library.
|
||||
@@ -532,13 +532,13 @@ patches = [
|
||||
{
|
||||
# Add RenderWidgetHostImpl::SetCompositorForFlingScheduler to fix fling
|
||||
# scrolling in OSR mode.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2745
|
||||
# https://github.com/chromiumembedded/cef/issues/2745
|
||||
'name': 'osr_fling_2745',
|
||||
},
|
||||
{
|
||||
# Windows: Build targets as C++17 to avoid export of std::is_integral
|
||||
# templates in cef_sandbox that should be inlined.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2819
|
||||
# https://github.com/chromiumembedded/cef/issues/2819
|
||||
'name': 'win_cpp17_msvc_sandbox_2819',
|
||||
},
|
||||
{
|
||||
@@ -558,7 +558,7 @@ patches = [
|
||||
#
|
||||
# Fix crash in NavigationRequest::GetOriginForURLLoaderFactory() when
|
||||
# navigating to an unregistered (e.g. non-standard) scheme.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3105
|
||||
# https://github.com/chromiumembedded/cef/issues/3105
|
||||
'name': 'browser_security_policy_1081397',
|
||||
},
|
||||
{
|
||||
@@ -566,7 +566,7 @@ patches = [
|
||||
# https://bugs.chromium.org/p/chromium/issues/detail?id=1100085
|
||||
#
|
||||
# Changes to support the Chrome runtime in CEF (app_controller_mac.mm).
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2969
|
||||
# https://github.com/chromiumembedded/cef/issues/2969
|
||||
'name': 'chrome_browser_background_mode_1100085',
|
||||
},
|
||||
{
|
||||
@@ -576,12 +576,12 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Windows: Fix crash when |sandbox_info| parameter is nullptr.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3210
|
||||
# https://github.com/chromiumembedded/cef/issues/3210
|
||||
'name': 'win_sandbox_3210',
|
||||
},
|
||||
{
|
||||
# Windows: Always use the root window as the owner for shell dialogs.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3294
|
||||
# https://github.com/chromiumembedded/cef/issues/3294
|
||||
'name': 'win_shell_dialogs_3294',
|
||||
},
|
||||
{
|
||||
@@ -591,7 +591,7 @@ patches = [
|
||||
},
|
||||
{
|
||||
# Linux: Support chaining of PrintingContextLinux callbacks.
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/3314
|
||||
# https://github.com/chromiumembedded/cef/issues/3314
|
||||
# Also reverts the changes from https://crrev.com/db245883e1
|
||||
'name': 'linux_printing_context',
|
||||
},
|
||||
@@ -617,10 +617,5 @@ patches = [
|
||||
# win: Add missing process_handle.h include for cef_sandbox build.
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/4294575
|
||||
'name': 'base_logging_4294575'
|
||||
},
|
||||
{
|
||||
# Fix Check failed: !*GetSingletonDisallowedTls() on shutdown.
|
||||
# https://chromium-review.googlesource.com/c/chromium/src/+/4294854
|
||||
'name': 'rlz_tracker_4294854'
|
||||
}
|
||||
]
|
||||
|
@@ -20,10 +20,10 @@ index 4dbf8a2811c9e..917b6a2e7b56f 100644
|
||||
|
||||
// Make an exception to allow most visited tiles to commit in
|
||||
diff --git content/browser/renderer_host/navigation_request.cc content/browser/renderer_host/navigation_request.cc
|
||||
index a02a6e4a5eb91..bd5ded3609b10 100644
|
||||
index d979fc0def505..aa41b2a792e4e 100644
|
||||
--- content/browser/renderer_host/navigation_request.cc
|
||||
+++ content/browser/renderer_host/navigation_request.cc
|
||||
@@ -6973,10 +6973,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
@@ -7021,10 +7021,22 @@ NavigationRequest::GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
bool use_opaque_origin =
|
||||
(sandbox_flags & network::mojom::WebSandboxFlags::kOrigin) ==
|
||||
network::mojom::WebSandboxFlags::kOrigin;
|
||||
@@ -47,7 +47,7 @@ index a02a6e4a5eb91..bd5ded3609b10 100644
|
||||
}
|
||||
|
||||
return origin_and_debug_info;
|
||||
@@ -7006,6 +7018,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
|
||||
@@ -7054,6 +7066,15 @@ NavigationRequest::GetOriginForURLLoaderFactoryAfterResponseWithDebugInfo() {
|
||||
GetOriginForURLLoaderFactoryBeforeResponseWithDebugInfo(
|
||||
SandboxFlagsToCommit());
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/BUILD.gn chrome/browser/BUILD.gn
|
||||
index cc7851e0bbb7e..4502edc5de8e6 100644
|
||||
index 0ddbd541f7ef4..a0d78f2db93a6 100644
|
||||
--- chrome/browser/BUILD.gn
|
||||
+++ chrome/browser/BUILD.gn
|
||||
@@ -11,6 +11,7 @@ import("//build/config/compiler/pgo/pgo.gni")
|
||||
@@ -10,7 +10,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644
|
||||
import("//chrome/browser/buildflags.gni")
|
||||
import("//chrome/browser/downgrade/buildflags.gni")
|
||||
import("//chrome/common/features.gni")
|
||||
@@ -1980,6 +1981,7 @@ static_library("browser") {
|
||||
@@ -1984,6 +1985,7 @@ static_library("browser") {
|
||||
"//build/config/chromebox_for_meetings:buildflags",
|
||||
"//build/config/compiler:compiler_buildflags",
|
||||
"//cc",
|
||||
@@ -18,7 +18,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644
|
||||
"//chrome:extra_resources",
|
||||
"//chrome:resources",
|
||||
"//chrome:strings",
|
||||
@@ -2548,6 +2550,10 @@ static_library("browser") {
|
||||
@@ -2552,6 +2554,10 @@ static_library("browser") {
|
||||
]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ index cc7851e0bbb7e..4502edc5de8e6 100644
|
||||
if (is_android) {
|
||||
sources += [
|
||||
"after_startup_task_utils_android.cc",
|
||||
@@ -6092,8 +6098,6 @@ static_library("browser") {
|
||||
@@ -6102,8 +6108,6 @@ static_library("browser") {
|
||||
sources += [
|
||||
"enterprise/chrome_browser_main_extra_parts_enterprise.cc",
|
||||
"enterprise/chrome_browser_main_extra_parts_enterprise.h",
|
||||
|
@@ -70,7 +70,7 @@ index 94f900fb2e05e..2d5719c3bc936 100644
|
||||
]
|
||||
}
|
||||
diff --git chrome/browser/ui/browser.cc chrome/browser/ui/browser.cc
|
||||
index f800d1439fd03..0eda6648fa029 100644
|
||||
index 8e86697ca27ec..7d2dd1dd23c24 100644
|
||||
--- chrome/browser/ui/browser.cc
|
||||
+++ chrome/browser/ui/browser.cc
|
||||
@@ -263,6 +263,25 @@
|
||||
@@ -177,7 +177,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
NavigateParams nav_params(this, params.url, params.transition);
|
||||
nav_params.FillNavigateParamsFromOpenURLParams(params);
|
||||
nav_params.source_contents = source;
|
||||
@@ -1723,6 +1781,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||
@@ -1725,6 +1783,8 @@ void Browser::LoadingStateChanged(WebContents* source,
|
||||
bool should_show_loading_ui) {
|
||||
ScheduleUIUpdate(source, content::INVALIDATE_TYPE_LOAD);
|
||||
UpdateWindowForLoadingStateChanged(source, should_show_loading_ui);
|
||||
@@ -186,7 +186,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
}
|
||||
|
||||
void Browser::CloseContents(WebContents* source) {
|
||||
@@ -1750,6 +1810,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||
@@ -1752,6 +1812,8 @@ void Browser::SetContentsBounds(WebContents* source, const gfx::Rect& bounds) {
|
||||
}
|
||||
|
||||
void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
@@ -195,7 +195,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
if (!GetStatusBubble())
|
||||
return;
|
||||
|
||||
@@ -1757,6 +1819,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
@@ -1759,6 +1821,17 @@ void Browser::UpdateTargetURL(WebContents* source, const GURL& url) {
|
||||
GetStatusBubble()->SetURL(url);
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
void Browser::ContentsMouseEvent(WebContents* source,
|
||||
bool motion,
|
||||
bool exited) {
|
||||
@@ -1781,6 +1854,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
||||
@@ -1783,6 +1856,19 @@ bool Browser::TakeFocus(content::WebContents* source, bool reverse) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
void Browser::BeforeUnloadFired(WebContents* web_contents,
|
||||
bool proceed,
|
||||
bool* proceed_to_fire_unload) {
|
||||
@@ -1873,6 +1959,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||
@@ -1875,6 +1961,10 @@ void Browser::WebContentsCreated(WebContents* source_contents,
|
||||
|
||||
// Make the tab show up in the task manager.
|
||||
task_manager::WebContentsTags::CreateForTabContents(new_contents);
|
||||
@@ -244,7 +244,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
}
|
||||
|
||||
void Browser::PortalWebContentsCreated(WebContents* portal_web_contents) {
|
||||
@@ -1984,11 +2074,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||
@@ -1986,11 +2076,15 @@ void Browser::EnterFullscreenModeForTab(
|
||||
const blink::mojom::FullscreenOptions& options) {
|
||||
exclusive_access_manager_->fullscreen_controller()->EnterFullscreenModeForTab(
|
||||
requesting_frame, options.display_id);
|
||||
@@ -260,7 +260,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
}
|
||||
|
||||
bool Browser::IsFullscreenForTabOrPending(const WebContents* web_contents) {
|
||||
@@ -2188,6 +2282,15 @@ void Browser::RequestMediaAccessPermission(
|
||||
@@ -2192,6 +2286,15 @@ void Browser::RequestMediaAccessPermission(
|
||||
content::WebContents* web_contents,
|
||||
const content::MediaStreamRequest& request,
|
||||
content::MediaResponseCallback callback) {
|
||||
@@ -276,7 +276,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
const extensions::Extension* extension =
|
||||
GetExtensionForOrigin(profile_, request.security_origin);
|
||||
MediaCaptureDevicesDispatcher::GetInstance()->ProcessMediaAccessRequest(
|
||||
@@ -2728,13 +2831,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
||||
@@ -2732,13 +2835,20 @@ void Browser::RemoveScheduledUpdatesFor(WebContents* contents) {
|
||||
// Browser, Getters for UI (private):
|
||||
|
||||
StatusBubble* Browser::GetStatusBubble() {
|
||||
@@ -298,7 +298,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
return window_ ? window_->GetStatusBubble() : nullptr;
|
||||
}
|
||||
|
||||
@@ -2868,6 +2978,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||
@@ -2872,6 +2982,8 @@ void Browser::SetAsDelegate(WebContents* web_contents, bool set_delegate) {
|
||||
BookmarkTabHelper::FromWebContents(web_contents)->RemoveObserver(this);
|
||||
web_contents_collection_.StopObserving(web_contents);
|
||||
}
|
||||
@@ -308,7 +308,7 @@ index f800d1439fd03..0eda6648fa029 100644
|
||||
|
||||
void Browser::TabDetachedAtImpl(content::WebContents* contents,
|
||||
diff --git chrome/browser/ui/browser.h chrome/browser/ui/browser.h
|
||||
index 486cff37b13ac..21a3a39f49247 100644
|
||||
index b8c8af5f2bace..6a0bbc591ab78 100644
|
||||
--- chrome/browser/ui/browser.h
|
||||
+++ chrome/browser/ui/browser.h
|
||||
@@ -22,6 +22,7 @@
|
||||
@@ -319,7 +319,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
#include "chrome/browser/tab_contents/web_contents_collection.h"
|
||||
#include "chrome/browser/themes/theme_service_observer.h"
|
||||
#include "chrome/browser/ui/bookmarks/bookmark_bar.h"
|
||||
@@ -48,6 +49,10 @@
|
||||
@@ -49,6 +50,10 @@
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/shell_dialogs/select_file_dialog.h"
|
||||
|
||||
@@ -330,7 +330,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
#if BUILDFLAG(IS_ANDROID)
|
||||
#error This file should only be included on desktop.
|
||||
#endif
|
||||
@@ -323,6 +328,11 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -324,6 +329,11 @@ class Browser : public TabStripModelObserver,
|
||||
double initial_aspect_ratio = 1.0;
|
||||
bool lock_aspect_ratio = false;
|
||||
|
||||
@@ -342,7 +342,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
private:
|
||||
friend class Browser;
|
||||
friend class WindowSizerChromeOSTest;
|
||||
@@ -398,6 +408,13 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -399,6 +409,13 @@ class Browser : public TabStripModelObserver,
|
||||
force_skip_warning_user_on_close_ = force_skip_warning_user_on_close;
|
||||
}
|
||||
|
||||
@@ -356,7 +356,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
// Accessors ////////////////////////////////////////////////////////////////
|
||||
|
||||
const CreateParams& create_params() const { return create_params_; }
|
||||
@@ -471,6 +488,12 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -472,6 +489,12 @@ class Browser : public TabStripModelObserver,
|
||||
|
||||
base::WeakPtr<Browser> AsWeakPtr();
|
||||
|
||||
@@ -369,7 +369,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
// Get the FindBarController for this browser, creating it if it does not
|
||||
// yet exist.
|
||||
FindBarController* GetFindBarController();
|
||||
@@ -847,11 +870,19 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -848,11 +871,19 @@ class Browser : public TabStripModelObserver,
|
||||
void SetContentsBounds(content::WebContents* source,
|
||||
const gfx::Rect& bounds) override;
|
||||
void UpdateTargetURL(content::WebContents* source, const GURL& url) override;
|
||||
@@ -389,7 +389,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
void BeforeUnloadFired(content::WebContents* source,
|
||||
bool proceed,
|
||||
bool* proceed_to_fire_unload) override;
|
||||
@@ -1255,6 +1286,8 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -1256,6 +1287,8 @@ class Browser : public TabStripModelObserver,
|
||||
const std::string initial_workspace_;
|
||||
bool initial_visible_on_all_workspaces_state_;
|
||||
|
||||
@@ -398,7 +398,7 @@ index 486cff37b13ac..21a3a39f49247 100644
|
||||
CreationSource creation_source_ = CreationSource::kUnknown;
|
||||
|
||||
UnloadController unload_controller_;
|
||||
@@ -1319,6 +1352,10 @@ class Browser : public TabStripModelObserver,
|
||||
@@ -1320,6 +1353,10 @@ class Browser : public TabStripModelObserver,
|
||||
extension_browser_window_helper_;
|
||||
#endif
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.cc chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
index e0d7724c3a341..40a25b08152a5 100644
|
||||
index a56e3f1fb8e08..d1b230cd66c63 100644
|
||||
--- chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
+++ chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
||||
@@ -315,6 +315,13 @@ base::OnceCallback<void(RenderViewContextMenu*)>* GetMenuShownCallback() {
|
||||
@@ -55,7 +55,7 @@ index e0d7724c3a341..40a25b08152a5 100644
|
||||
}
|
||||
|
||||
Profile* RenderViewContextMenu::GetProfile() const {
|
||||
@@ -3130,6 +3155,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
|
||||
@@ -3128,6 +3153,12 @@ void RenderViewContextMenu::RegisterExecutePluginActionCallbackForTesting(
|
||||
execute_plugin_action_callback_ = std::move(cb);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ index e0d7724c3a341..40a25b08152a5 100644
|
||||
RenderViewContextMenu::GetHandlersForLinkUrl() {
|
||||
custom_handlers::ProtocolHandlerRegistry::ProtocolHandlerList handlers =
|
||||
diff --git chrome/browser/renderer_context_menu/render_view_context_menu.h chrome/browser/renderer_context_menu/render_view_context_menu.h
|
||||
index 19678cd892b6e..1e65a38e4cc69 100644
|
||||
index dfafe093f5ec6..8af3aff4f8958 100644
|
||||
--- chrome/browser/renderer_context_menu/render_view_context_menu.h
|
||||
+++ chrome/browser/renderer_context_menu/render_view_context_menu.h
|
||||
@@ -139,6 +139,12 @@ class RenderViewContextMenu
|
||||
@@ -85,7 +85,7 @@ index 19678cd892b6e..1e65a38e4cc69 100644
|
||||
protected:
|
||||
Profile* GetProfile() const;
|
||||
|
||||
@@ -389,6 +395,9 @@ class RenderViewContextMenu
|
||||
@@ -384,6 +390,9 @@ class RenderViewContextMenu
|
||||
// built.
|
||||
bool is_protocol_submenu_valid_ = false;
|
||||
|
||||
|
@@ -337,7 +337,7 @@ index 7ecb90a89f1d7..c80ce831382db 100644
|
||||
#endif
|
||||
|
||||
diff --git chrome/browser/prefs/browser_prefs.cc chrome/browser/prefs/browser_prefs.cc
|
||||
index ff57c231cc784..59ac71c36caa0 100644
|
||||
index 3b9ce2a93d09d..049fd4e069aab 100644
|
||||
--- chrome/browser/prefs/browser_prefs.cc
|
||||
+++ chrome/browser/prefs/browser_prefs.cc
|
||||
@@ -11,6 +11,7 @@
|
||||
@@ -359,7 +359,7 @@ index ff57c231cc784..59ac71c36caa0 100644
|
||||
#if BUILDFLAG(ENABLE_EXTENSIONS)
|
||||
#include "chrome/browser/accessibility/animation_policy_prefs.h"
|
||||
#include "chrome/browser/apps/platform_apps/shortcut_manager.h"
|
||||
@@ -1305,6 +1310,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
@@ -1306,6 +1311,11 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
|
||||
|
||||
// This is intentionally last.
|
||||
RegisterLocalStatePrefsForMigration(registry);
|
||||
@@ -371,7 +371,7 @@ index ff57c231cc784..59ac71c36caa0 100644
|
||||
}
|
||||
|
||||
// Register prefs applicable to all profiles.
|
||||
@@ -1704,6 +1714,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
@@ -1705,6 +1715,10 @@ void RegisterUserProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
const std::string& locale) {
|
||||
RegisterProfilePrefs(registry, locale);
|
||||
|
||||
|
@@ -40,6 +40,182 @@ index f91c359d9792a..9fe7a7faf33bc 100644
|
||||
}
|
||||
|
||||
bool BrowserCommandController::IsWebAppOrCustomTab() const {
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.cc chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
index 655ce2353f106..e9dd7ed68b9c5 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.cc
|
||||
@@ -151,6 +151,57 @@ absl::optional<std::u16string> GetInstallPWAAppMenuItemName(Browser* browser) {
|
||||
ui::EscapeMenuLabelAmpersands(app_name));
|
||||
}
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+using IsVisibleCallback = base::RepeatingCallback<bool(int)>;
|
||||
+
|
||||
+void FilterMenuModel(ui::SimpleMenuModel* model,
|
||||
+ const IsVisibleCallback& is_visible) {
|
||||
+ absl::optional<size_t> last_separator;
|
||||
+ size_t visible_ct = 0;
|
||||
+ for (size_t i = 0; i < model->GetItemCount(); ++i) {
|
||||
+ const auto type = model->GetTypeAt(i);
|
||||
+ if (type == ui::MenuModel::TYPE_SEPARATOR) {
|
||||
+ if (last_separator) {
|
||||
+ // Remove multiple separators in a row. Prefer to remove a NORMAL
|
||||
+ // separator if possible (as compared to zoom/edit controls which use
|
||||
+ // UPPER/LOWER separators).
|
||||
+ if (model->GetSeparatorTypeAt(*last_separator) ==
|
||||
+ ui::NORMAL_SEPARATOR) {
|
||||
+ model->RemoveItemAt(*last_separator);
|
||||
+ i--;
|
||||
+ last_separator = i;
|
||||
+ } else {
|
||||
+ model->RemoveItemAt(i);
|
||||
+ i--;
|
||||
+ }
|
||||
+ } else if (visible_ct == 0) {
|
||||
+ // Remove leading separator.
|
||||
+ model->RemoveItemAt(i);
|
||||
+ i--;
|
||||
+ } else {
|
||||
+ last_separator = i;
|
||||
+ }
|
||||
+ visible_ct = 0;
|
||||
+ } else if (is_visible.Run(model->GetCommandIdAt(i))) {
|
||||
+ last_separator = absl::nullopt;
|
||||
+ visible_ct++;
|
||||
+
|
||||
+ if (type == ui::MenuModel::TYPE_SUBMENU) {
|
||||
+ // Filter sub-menu.
|
||||
+ auto sub_model =
|
||||
+ static_cast<ui::SimpleMenuModel*>(model->GetSubmenuModelAt(i));
|
||||
+ FilterMenuModel(sub_model, is_visible);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if (last_separator) {
|
||||
+ // Remove trailing separator.
|
||||
+ model->RemoveItemAt(*last_separator);
|
||||
+ }
|
||||
+}
|
||||
+#endif // BUILDFLAG(ENABLE_CEF)
|
||||
+
|
||||
} // namespace
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -756,7 +807,7 @@ bool AppMenuModel::IsCommandIdChecked(int command_id) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
-bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
|
||||
+bool AppMenuModel::IsCommandIdEnabledInternal(int command_id) const {
|
||||
GlobalError* error =
|
||||
GlobalErrorServiceFactory::GetForProfile(browser_->profile())
|
||||
->GetGlobalErrorByMenuItemCommandID(command_id);
|
||||
@@ -771,7 +822,7 @@ bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
|
||||
}
|
||||
}
|
||||
|
||||
-bool AppMenuModel::IsCommandIdVisible(int command_id) const {
|
||||
+bool AppMenuModel::IsCommandIdVisibleInternal(int command_id) const {
|
||||
switch (command_id) {
|
||||
case IDC_PIN_TO_START_SCREEN:
|
||||
return false;
|
||||
@@ -794,6 +845,34 @@ bool AppMenuModel::IsCommandIdVisible(int command_id) const {
|
||||
}
|
||||
}
|
||||
|
||||
+bool AppMenuModel::IsCommandIdEnabled(int command_id) const {
|
||||
+ if (!IsCommandIdEnabledInternal(command_id)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (browser_->cef_delegate()) {
|
||||
+ return browser_->cef_delegate()->IsAppMenuItemEnabled(command_id);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+bool AppMenuModel::IsCommandIdVisible(int command_id) const {
|
||||
+ if (!IsCommandIdVisibleInternal(command_id)) {
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (browser_->cef_delegate()) {
|
||||
+ return browser_->cef_delegate()->IsAppMenuItemVisible(command_id);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
bool AppMenuModel::IsCommandIdAlerted(int command_id) const {
|
||||
if ((command_id == IDC_RECENT_TABS_MENU) ||
|
||||
(command_id == AppMenuModel::kMinRecentTabsCommandId)) {
|
||||
@@ -899,9 +978,13 @@ void AppMenuModel::Build() {
|
||||
bookmark_sub_menu_model_.get());
|
||||
}
|
||||
|
||||
- AddSeparator(ui::LOWER_SEPARATOR);
|
||||
- CreateZoomMenu();
|
||||
- AddSeparator(ui::UPPER_SEPARATOR);
|
||||
+ if (IsCommandIdVisible(IDC_ZOOM_MENU)) {
|
||||
+ AddSeparator(ui::LOWER_SEPARATOR);
|
||||
+ CreateZoomMenu();
|
||||
+ AddSeparator(ui::UPPER_SEPARATOR);
|
||||
+ } else {
|
||||
+ AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
+ }
|
||||
|
||||
AddItemWithStringId(IDC_PRINT, IDS_PRINT);
|
||||
|
||||
@@ -965,9 +1048,14 @@ void AppMenuModel::Build() {
|
||||
sub_menus_.back().get());
|
||||
SetElementIdentifierAt(GetIndexOfCommandId(IDC_MORE_TOOLS_MENU).value(),
|
||||
kMoreToolsMenuItem);
|
||||
- AddSeparator(ui::LOWER_SEPARATOR);
|
||||
- CreateCutCopyPasteMenu();
|
||||
- AddSeparator(ui::UPPER_SEPARATOR);
|
||||
+
|
||||
+ if (IsCommandIdVisible(IDC_EDIT_MENU)) {
|
||||
+ AddSeparator(ui::LOWER_SEPARATOR);
|
||||
+ CreateCutCopyPasteMenu();
|
||||
+ AddSeparator(ui::UPPER_SEPARATOR);
|
||||
+ } else {
|
||||
+ AddSeparator(ui::NORMAL_SEPARATOR);
|
||||
+ }
|
||||
|
||||
AddItemWithStringId(IDC_OPTIONS, IDS_SETTINGS);
|
||||
// The help submenu is only displayed on official Chrome builds. As the
|
||||
@@ -1004,6 +1092,11 @@ void AppMenuModel::Build() {
|
||||
}
|
||||
#endif // !BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ FilterMenuModel(this, base::BindRepeating(&AppMenuModel::IsCommandIdVisible,
|
||||
+ base::Unretained(this)));
|
||||
+#endif
|
||||
+
|
||||
uma_action_recorded_ = false;
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/toolbar/app_menu_model.h chrome/browser/ui/toolbar/app_menu_model.h
|
||||
index fa3ceed419c16..522671662cbdf 100644
|
||||
--- chrome/browser/ui/toolbar/app_menu_model.h
|
||||
+++ chrome/browser/ui/toolbar/app_menu_model.h
|
||||
@@ -208,6 +208,9 @@ class AppMenuModel : public ui::SimpleMenuModel,
|
||||
// Appends a zoom menu (without separators).
|
||||
void CreateZoomMenu();
|
||||
|
||||
+ bool IsCommandIdEnabledInternal(int command_id) const;
|
||||
+ bool IsCommandIdVisibleInternal(int command_id) const;
|
||||
+
|
||||
private:
|
||||
friend class ::MockAppMenuModel;
|
||||
|
||||
diff --git chrome/browser/ui/views/frame/browser_frame.cc chrome/browser/ui/views/frame/browser_frame.cc
|
||||
index 090ad157308b7..d0534ffb8091c 100644
|
||||
--- chrome/browser/ui/views/frame/browser_frame.cc
|
||||
@@ -418,6 +594,23 @@ index 5e059b9878fc2..c1f6fbcd40ec4 100644
|
||||
}
|
||||
|
||||
ContentsWebView::~ContentsWebView() {
|
||||
diff --git chrome/browser/ui/views/page_action/page_action_icon_controller.cc chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
index c26f017f45682..f9f875292c7d6 100644
|
||||
--- chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
+++ chrome/browser/ui/views/page_action/page_action_icon_controller.cc
|
||||
@@ -91,6 +91,12 @@ void PageActionIconController::Init(const PageActionIconParams& params,
|
||||
};
|
||||
|
||||
for (PageActionIconType type : params.types_enabled) {
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ if (params.browser && params.browser->cef_delegate() &&
|
||||
+ !params.browser->cef_delegate()->IsPageActionIconVisible(type)) {
|
||||
+ continue;
|
||||
+ }
|
||||
+#endif
|
||||
switch (type) {
|
||||
case PageActionIconType::kPaymentsOfferNotification:
|
||||
add_page_action_icon(
|
||||
diff --git chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
||||
index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
|
||||
--- chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc
|
||||
@@ -471,7 +664,7 @@ index f4a5c3ad8cc9c..4f9c1a111e7ce 100644
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/toolbar/toolbar_view.cc chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
index 65ba764446ced..dbe856f34caca 100644
|
||||
index 65ba764446ced..140ff05e1b276 100644
|
||||
--- chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
+++ chrome/browser/ui/views/toolbar/toolbar_view.cc
|
||||
@@ -164,12 +164,13 @@ auto& GetViewCommandMap() {
|
||||
@@ -499,6 +692,65 @@ index 65ba764446ced..dbe856f34caca 100644
|
||||
// Make sure the toolbar shows by default.
|
||||
size_animation_.Reset(1);
|
||||
|
||||
@@ -224,6 +225,19 @@ void ToolbarView::Init() {
|
||||
browser, command, ui::DispositionFromEventFlags(event.flags()));
|
||||
};
|
||||
|
||||
+#if BUILDFLAG(ENABLE_CEF)
|
||||
+ using ToolbarButtonType = cef::BrowserDelegate::ToolbarButtonType;
|
||||
+ auto button_visible = [this](ToolbarButtonType type) {
|
||||
+ if (this->browser_->cef_delegate()) {
|
||||
+ return this->browser_->cef_delegate()->IsToolbarButtonVisible(type);
|
||||
+ }
|
||||
+ return true;
|
||||
+ };
|
||||
+ #define BUTTON_VISIBLE(type) button_visible(ToolbarButtonType::type)
|
||||
+#else
|
||||
+ #define BUTTON_VISIBLE(type) true
|
||||
+#endif
|
||||
+
|
||||
std::unique_ptr<ToolbarButton> back = std::make_unique<BackForwardButton>(
|
||||
BackForwardButton::Direction::kBack,
|
||||
base::BindRepeating(callback, browser_, IDC_BACK), browser_);
|
||||
@@ -248,8 +262,10 @@ void ToolbarView::Init() {
|
||||
std::make_unique<ExtensionsToolbarContainer>(browser_);
|
||||
}
|
||||
std::unique_ptr<media_router::CastToolbarButton> cast;
|
||||
- if (media_router::MediaRouterEnabled(browser_->profile()))
|
||||
+ if (media_router::MediaRouterEnabled(browser_->profile()) &&
|
||||
+ BUTTON_VISIBLE(kCast)) {
|
||||
cast = media_router::CastToolbarButton::Create(browser_);
|
||||
+ }
|
||||
|
||||
std::unique_ptr<MediaToolbarButtonView> media_button;
|
||||
if (base::FeatureList::IsEnabled(media::kGlobalMediaControls)) {
|
||||
@@ -258,21 +274,23 @@ void ToolbarView::Init() {
|
||||
}
|
||||
|
||||
std::unique_ptr<DownloadToolbarButtonView> download_button;
|
||||
- if (download::IsDownloadBubbleEnabled(browser_->profile())) {
|
||||
+ if (download::IsDownloadBubbleEnabled(browser_->profile()) &&
|
||||
+ BUTTON_VISIBLE(kDownload)) {
|
||||
download_button =
|
||||
std::make_unique<DownloadToolbarButtonView>(browser_view_);
|
||||
}
|
||||
|
||||
std::unique_ptr<send_tab_to_self::SendTabToSelfToolbarIconView>
|
||||
send_tab_to_self_button;
|
||||
- if (!browser_->profile()->IsOffTheRecord()) {
|
||||
+ if (!browser_->profile()->IsOffTheRecord() &&
|
||||
+ BUTTON_VISIBLE(kSendTabToSelf)) {
|
||||
send_tab_to_self_button =
|
||||
std::make_unique<send_tab_to_self::SendTabToSelfToolbarIconView>(
|
||||
browser_view_);
|
||||
}
|
||||
|
||||
std::unique_ptr<SidePanelToolbarButton> side_panel_button;
|
||||
- if (browser_view_->unified_side_panel()) {
|
||||
+ if (browser_view_->unified_side_panel() && BUTTON_VISIBLE(kSidePanel)) {
|
||||
side_panel_button = std::make_unique<SidePanelToolbarButton>(browser_);
|
||||
}
|
||||
|
||||
diff --git chrome/browser/ui/views/toolbar/toolbar_view.h chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
index 05dfd39061580..29c677a735672 100644
|
||||
--- chrome/browser/ui/views/toolbar/toolbar_view.h
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git printing/printing_context_linux.cc printing/printing_context_linux.cc
|
||||
index 5520e15c232c8..2648037fcf37e 100644
|
||||
index 63af3dd95eada..dc89a9c5c5e47 100644
|
||||
--- printing/printing_context_linux.cc
|
||||
+++ printing/printing_context_linux.cc
|
||||
@@ -69,11 +69,11 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
|
||||
@@ -13,10 +13,10 @@ index 5520e15c232c8..2648037fcf37e 100644
|
||||
if (!print_dialog_)
|
||||
- print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this);
|
||||
+ print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this);
|
||||
print_dialog_->UseDefaultSettings();
|
||||
#endif
|
||||
|
||||
@@ -82,8 +82,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
|
||||
if (print_dialog_) {
|
||||
print_dialog_->UseDefaultSettings();
|
||||
@@ -85,8 +85,8 @@ mojom::ResultCode PrintingContextLinux::UseDefaultSettings() {
|
||||
|
||||
gfx::Size PrintingContextLinux::GetPdfPaperSizeDeviceUnits() {
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
@@ -27,7 +27,7 @@ index 5520e15c232c8..2648037fcf37e 100644
|
||||
#endif
|
||||
|
||||
return gfx::Size();
|
||||
@@ -95,11 +95,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings(
|
||||
@@ -98,11 +98,11 @@ mojom::ResultCode PrintingContextLinux::UpdatePrinterSettings(
|
||||
DCHECK(!in_print_job_);
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
@@ -39,8 +39,8 @@ index 5520e15c232c8..2648037fcf37e 100644
|
||||
- print_dialog_ = ui::LinuxUi::instance()->CreatePrintDialog(this);
|
||||
+ print_dialog_ = ui::PrintingContextLinuxDelegate::instance()->CreatePrintDialog(this);
|
||||
|
||||
// PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will
|
||||
// remain non-null after this line.
|
||||
if (print_dialog_) {
|
||||
// PrintDialogGtk::UpdateSettings() calls InitWithSettings() so settings_ will
|
||||
diff --git ui/linux/linux_ui.cc ui/linux/linux_ui.cc
|
||||
index 29db798e8b171..f8b9546b90321 100644
|
||||
--- ui/linux/linux_ui.cc
|
||||
@@ -76,7 +76,7 @@ index 29db798e8b171..f8b9546b90321 100644
|
||||
}
|
||||
|
||||
diff --git ui/linux/linux_ui.h ui/linux/linux_ui.h
|
||||
index b5fd57741d2f4..eaab5f1bd2b0b 100644
|
||||
index 82d40cb5fa1b9..0a08bec8a6e61 100644
|
||||
--- ui/linux/linux_ui.h
|
||||
+++ ui/linux/linux_ui.h
|
||||
@@ -18,6 +18,10 @@
|
||||
|
@@ -1,5 +1,5 @@
|
||||
diff --git chrome/browser/download/download_prefs.cc chrome/browser/download/download_prefs.cc
|
||||
index 6fe1ebe84e584..2500dac50ffe3 100644
|
||||
index 4b7fcf619a55d..139fd5b4a2bd0 100644
|
||||
--- chrome/browser/download/download_prefs.cc
|
||||
+++ chrome/browser/download/download_prefs.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
@@ -21,7 +21,7 @@ index 6fe1ebe84e584..2500dac50ffe3 100644
|
||||
using content::BrowserContext;
|
||||
using content::BrowserThread;
|
||||
using content::DownloadManager;
|
||||
@@ -355,6 +360,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
|
||||
@@ -358,6 +363,11 @@ DownloadPrefs* DownloadPrefs::FromDownloadManager(
|
||||
// static
|
||||
DownloadPrefs* DownloadPrefs::FromBrowserContext(
|
||||
content::BrowserContext* context) {
|
||||
|
@@ -1,36 +0,0 @@
|
||||
diff --git components/rlz/rlz_tracker.cc components/rlz/rlz_tracker.cc
|
||||
index b59d3ba6f1aa4..74e488cd4f3c6 100644
|
||||
--- components/rlz/rlz_tracker.cc
|
||||
+++ components/rlz/rlz_tracker.cc
|
||||
@@ -219,7 +219,8 @@ class RLZTracker::WrapperURLLoaderFactory
|
||||
|
||||
// static
|
||||
RLZTracker* RLZTracker::GetInstance() {
|
||||
- return tracker_ ? tracker_ : base::Singleton<RLZTracker>::get();
|
||||
+ static base::NoDestructor<RLZTracker> instance;
|
||||
+ return tracker_ ? tracker_ : instance.get();
|
||||
}
|
||||
|
||||
RLZTracker::RLZTracker()
|
||||
diff --git components/rlz/rlz_tracker.h components/rlz/rlz_tracker.h
|
||||
index 5e30a66838620..bd2166db1f53f 100644
|
||||
--- components/rlz/rlz_tracker.h
|
||||
+++ components/rlz/rlz_tracker.h
|
||||
@@ -10,7 +10,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "base/memory/ref_counted.h"
|
||||
-#include "base/memory/singleton.h"
|
||||
+#include "base/no_destructor.h"
|
||||
#include "base/sequence_checker.h"
|
||||
#include "base/thread_annotations.h"
|
||||
#include "base/time/time.h"
|
||||
@@ -128,7 +128,7 @@ class RLZTracker {
|
||||
void PingNowImpl();
|
||||
|
||||
private:
|
||||
- friend struct base::DefaultSingletonTraits<RLZTracker>;
|
||||
+ friend class base::NoDestructor<RLZTracker>;
|
||||
friend class base::RefCountedThreadSafe<RLZTracker>;
|
||||
|
||||
// Implementation called from SetRlzDelegate() static method.
|
@@ -1,5 +1,5 @@
|
||||
diff --git content/browser/storage_partition_impl.cc content/browser/storage_partition_impl.cc
|
||||
index c0a0fa84be58e..59543775a9c5b 100644
|
||||
index e4c4ecda89e71..03b48a6e4c091 100644
|
||||
--- content/browser/storage_partition_impl.cc
|
||||
+++ content/browser/storage_partition_impl.cc
|
||||
@@ -494,10 +494,6 @@ class LoginHandlerDelegate {
|
||||
|
@@ -1,8 +1,8 @@
|
||||
diff --git content/browser/web_contents/web_contents_impl.cc content/browser/web_contents/web_contents_impl.cc
|
||||
index 39e8934e0d54b..bbc9d78392973 100644
|
||||
index ddfd5e91cf73a..a859c3cbb5b73 100644
|
||||
--- content/browser/web_contents/web_contents_impl.cc
|
||||
+++ content/browser/web_contents/web_contents_impl.cc
|
||||
@@ -3175,6 +3175,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3165,6 +3165,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
params.main_frame_name, GetOpener(), primary_main_frame_policy,
|
||||
base::UnguessableToken::Create());
|
||||
|
||||
@@ -15,7 +15,7 @@ index 39e8934e0d54b..bbc9d78392973 100644
|
||||
std::unique_ptr<WebContentsViewDelegate> delegate =
|
||||
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
||||
|
||||
@@ -3185,6 +3191,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
@@ -3175,6 +3181,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
|
||||
view_ = CreateWebContentsView(this, std::move(delegate),
|
||||
&render_view_host_delegate_view_);
|
||||
}
|
||||
@@ -23,7 +23,7 @@ index 39e8934e0d54b..bbc9d78392973 100644
|
||||
CHECK(render_view_host_delegate_view_);
|
||||
CHECK(view_.get());
|
||||
|
||||
@@ -3365,6 +3372,9 @@ void WebContentsImpl::RenderWidgetCreated(
|
||||
@@ -3355,6 +3362,9 @@ void WebContentsImpl::RenderWidgetCreated(
|
||||
OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RenderWidgetCreated",
|
||||
"render_widget_host", render_widget_host);
|
||||
created_widgets_.insert(render_widget_host);
|
||||
@@ -33,7 +33,7 @@ index 39e8934e0d54b..bbc9d78392973 100644
|
||||
}
|
||||
|
||||
void WebContentsImpl::RenderWidgetDeleted(
|
||||
@@ -4096,6 +4106,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
@@ -4086,6 +4096,15 @@ FrameTree* WebContentsImpl::CreateNewWindow(
|
||||
create_params.picture_in_picture_options = *(params.pip_options);
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ index 39e8934e0d54b..bbc9d78392973 100644
|
||||
// Check whether there is an available prerendered page for this navigation if
|
||||
// this is not for guest. If it exists, take WebContents pre-created for
|
||||
// hosting the prerendered page instead of creating new WebContents.
|
||||
@@ -7999,6 +8018,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
@@ -7997,6 +8016,9 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
||||
// frames).
|
||||
SetFocusedFrameTree(&node->frame_tree());
|
||||
}
|
||||
@@ -88,10 +88,10 @@ index 5644b0efa9a3e..da63511c87213 100644
|
||||
// the value that'll be returned by GetLastActiveTime(). If this is left
|
||||
// default initialized then the value is not passed on to the WebContents
|
||||
diff --git content/public/browser/web_contents_delegate.h content/public/browser/web_contents_delegate.h
|
||||
index b7325f818a264..d37cb4da81eb6 100644
|
||||
index 5da6f93293bc5..349ae25c0af08 100644
|
||||
--- content/public/browser/web_contents_delegate.h
|
||||
+++ content/public/browser/web_contents_delegate.h
|
||||
@@ -58,9 +58,11 @@ class EyeDropperListener;
|
||||
@@ -59,9 +59,11 @@ class EyeDropperListener;
|
||||
class FileSelectListener;
|
||||
class JavaScriptDialogManager;
|
||||
class RenderFrameHost;
|
||||
@@ -103,7 +103,7 @@ index b7325f818a264..d37cb4da81eb6 100644
|
||||
struct ContextMenuParams;
|
||||
struct DropData;
|
||||
struct MediaPlayerWatchTime;
|
||||
@@ -342,6 +344,14 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
@@ -343,6 +345,14 @@ class CONTENT_EXPORT WebContentsDelegate {
|
||||
const StoragePartitionConfig& partition_config,
|
||||
SessionStorageNamespace* session_storage_namespace);
|
||||
|
||||
|
@@ -62,10 +62,10 @@ index dcd53ce7503b0..a30c89bf46884 100644
|
||||
gfx::Transform device_emulation_transform_;
|
||||
|
||||
diff --git third_party/blink/renderer/core/page/chrome_client_impl.cc third_party/blink/renderer/core/page/chrome_client_impl.cc
|
||||
index c1e0b9eff83cb..333ad8c8e2990 100644
|
||||
index 77260f7c32736..3958ea3f812c2 100644
|
||||
--- third_party/blink/renderer/core/page/chrome_client_impl.cc
|
||||
+++ third_party/blink/renderer/core/page/chrome_client_impl.cc
|
||||
@@ -916,7 +916,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
|
||||
@@ -913,7 +913,7 @@ bool ChromeClientImpl::HasOpenedPopup() const {
|
||||
PopupMenu* ChromeClientImpl::OpenPopupMenu(LocalFrame& frame,
|
||||
HTMLSelectElement& select) {
|
||||
NotifyPopupOpeningObservers();
|
||||
|
@@ -301,6 +301,133 @@ void OnTestSMRProcessMessageReceived(
|
||||
frame->SendProcessMessage(PID_RENDERER, builder->Build());
|
||||
}
|
||||
|
||||
bool IsAllowedPageActionIcon(cef_chrome_page_action_icon_type_t icon_type) {
|
||||
// Only the specified icons will be allowed.
|
||||
switch (icon_type) {
|
||||
case CEF_CPAIT_FIND:
|
||||
case CEF_CPAIT_ZOOM:
|
||||
return true;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAllowedToolbarButton(cef_chrome_toolbar_button_type_t button_type) {
|
||||
// All configurable buttons will be disabled.
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAllowedAppMenuCommandId(int command_id) {
|
||||
// Only the commands in this array will be allowed.
|
||||
static const int kAllowedCommandIds[] = {
|
||||
IDC_NEW_WINDOW,
|
||||
IDC_NEW_INCOGNITO_WINDOW,
|
||||
|
||||
// Zoom buttons.
|
||||
IDC_ZOOM_MENU,
|
||||
IDC_ZOOM_PLUS,
|
||||
IDC_ZOOM_NORMAL,
|
||||
IDC_ZOOM_MINUS,
|
||||
IDC_FULLSCREEN,
|
||||
|
||||
IDC_PRINT,
|
||||
IDC_FIND,
|
||||
|
||||
// "More tools" sub-menu and contents.
|
||||
IDC_MORE_TOOLS_MENU,
|
||||
IDC_CLEAR_BROWSING_DATA,
|
||||
IDC_MANAGE_EXTENSIONS,
|
||||
IDC_PERFORMANCE,
|
||||
IDC_TASK_MANAGER,
|
||||
IDC_DEV_TOOLS,
|
||||
|
||||
// Edit buttons.
|
||||
IDC_EDIT_MENU,
|
||||
IDC_CUT,
|
||||
IDC_COPY,
|
||||
IDC_PASTE,
|
||||
|
||||
IDC_OPTIONS,
|
||||
IDC_EXIT,
|
||||
};
|
||||
for (size_t i = 0; i < std::size(kAllowedCommandIds); ++i) {
|
||||
if (command_id == kAllowedCommandIds[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IsAllowedContextMenuCommandId(int command_id) {
|
||||
// Allow commands added by web content.
|
||||
if (command_id >= IDC_CONTENT_CONTEXT_CUSTOM_FIRST &&
|
||||
command_id <= IDC_CONTENT_CONTEXT_CUSTOM_LAST) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Allow commands added by extensions.
|
||||
if (command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST &&
|
||||
command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Only the commands in this array will be allowed.
|
||||
static const int kAllowedCommandIds[] = {
|
||||
// Page navigation.
|
||||
IDC_BACK,
|
||||
IDC_FORWARD,
|
||||
IDC_RELOAD,
|
||||
IDC_RELOAD_BYPASSING_CACHE,
|
||||
IDC_RELOAD_CLEARING_CACHE,
|
||||
IDC_STOP,
|
||||
|
||||
// Printing.
|
||||
IDC_PRINT,
|
||||
|
||||
// Edit controls.
|
||||
IDC_CONTENT_CONTEXT_CUT,
|
||||
IDC_CONTENT_CONTEXT_COPY,
|
||||
IDC_CONTENT_CONTEXT_PASTE,
|
||||
IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE,
|
||||
IDC_CONTENT_CONTEXT_DELETE,
|
||||
IDC_CONTENT_CONTEXT_SELECTALL,
|
||||
IDC_CONTENT_CONTEXT_UNDO,
|
||||
IDC_CONTENT_CONTEXT_REDO,
|
||||
};
|
||||
for (size_t i = 0; i < std::size(kAllowedCommandIds); ++i) {
|
||||
if (command_id == kAllowedCommandIds[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void FilterContextMenuModel(CefRefPtr<CefMenuModel> model) {
|
||||
// Evaluate from the bottom to the top because we'll be removing menu items.
|
||||
for (size_t x = model->GetCount(); x > 0; --x) {
|
||||
const auto i = x - 1;
|
||||
const auto type = model->GetTypeAt(i);
|
||||
if (type == MENUITEMTYPE_SUBMENU) {
|
||||
// Filter sub-menu and remove if empty.
|
||||
auto sub_model = model->GetSubMenuAt(i);
|
||||
FilterContextMenuModel(sub_model);
|
||||
if (sub_model->GetCount() == 0) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
} else if (type == MENUITEMTYPE_SEPARATOR) {
|
||||
// A separator shouldn't be the first or last element in the menu, and
|
||||
// there shouldn't be multiple in a row.
|
||||
if (i == 0 || i == model->GetCount() - 1 ||
|
||||
model->GetTypeAt(i + 1) == MENUITEMTYPE_SEPARATOR) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
} else if (!IsAllowedContextMenuCommandId(model->GetCommandIdAt(i))) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
class ClientDownloadImageCallback : public CefDownloadImageCallback {
|
||||
@@ -343,6 +470,8 @@ ClientHandler::ClientHandler(Delegate* delegate,
|
||||
mouse_cursor_change_disabled_ =
|
||||
command_line->HasSwitch(switches::kMouseCursorChangeDisabled);
|
||||
offline_ = command_line->HasSwitch(switches::kOffline);
|
||||
filter_chrome_commands_ =
|
||||
command_line->HasSwitch(switches::kFilterChromeCommands);
|
||||
|
||||
#if defined(OS_LINUX)
|
||||
// Optionally use the client-provided GTK dialogs.
|
||||
@@ -442,10 +571,20 @@ bool ClientHandler::OnChromeCommand(CefRefPtr<CefBrowser> browser,
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(MainContext::Get()->UseChromeRuntime());
|
||||
|
||||
if (!with_controls_ &&
|
||||
(disposition != WOD_CURRENT_TAB || !IsAllowedCommandId(command_id))) {
|
||||
// Block everything that doesn't target the current tab or isn't an
|
||||
// allowed command ID.
|
||||
const bool allowed = IsAllowedAppMenuCommandId(command_id) ||
|
||||
IsAllowedContextMenuCommandId(command_id);
|
||||
|
||||
bool block = false;
|
||||
if (filter_chrome_commands_) {
|
||||
// Block all commands that aren't specifically allowed.
|
||||
block = !allowed;
|
||||
} else if (!with_controls_) {
|
||||
// If controls are hidden, block all commands that don't target the current
|
||||
// tab or aren't specifically allowed.
|
||||
block = disposition != WOD_CURRENT_TAB || !allowed;
|
||||
}
|
||||
|
||||
if (block) {
|
||||
LOG(INFO) << "Blocking command " << command_id << " with disposition "
|
||||
<< disposition;
|
||||
return true;
|
||||
@@ -455,6 +594,36 @@ bool ClientHandler::OnChromeCommand(CefRefPtr<CefBrowser> browser,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool ClientHandler::IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(MainContext::Get()->UseChromeRuntime());
|
||||
if (!filter_chrome_commands_) {
|
||||
return true;
|
||||
}
|
||||
return IsAllowedAppMenuCommandId(command_id);
|
||||
}
|
||||
|
||||
bool ClientHandler::IsChromePageActionIconVisible(
|
||||
cef_chrome_page_action_icon_type_t icon_type) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(MainContext::Get()->UseChromeRuntime());
|
||||
if (!filter_chrome_commands_) {
|
||||
return true;
|
||||
}
|
||||
return IsAllowedPageActionIcon(icon_type);
|
||||
}
|
||||
|
||||
bool ClientHandler::IsChromeToolbarButtonVisible(
|
||||
cef_chrome_toolbar_button_type_t button_type) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(MainContext::Get()->UseChromeRuntime());
|
||||
if (!filter_chrome_commands_) {
|
||||
return true;
|
||||
}
|
||||
return IsAllowedToolbarButton(button_type);
|
||||
}
|
||||
|
||||
void ClientHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
CefRefPtr<CefContextMenuParams> params,
|
||||
@@ -462,9 +631,9 @@ void ClientHandler::OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
|
||||
const bool use_chrome_runtime = MainContext::Get()->UseChromeRuntime();
|
||||
if (use_chrome_runtime && !with_controls_) {
|
||||
if (use_chrome_runtime && (!with_controls_ || filter_chrome_commands_)) {
|
||||
// Remove all disallowed menu items.
|
||||
FilterMenuModel(model);
|
||||
FilterContextMenuModel(model);
|
||||
}
|
||||
|
||||
if ((params->GetTypeFlags() & (CM_TYPEFLAG_PAGE | CM_TYPEFLAG_FRAME)) != 0) {
|
||||
@@ -1438,61 +1607,4 @@ void ClientHandler::SetOfflineState(CefRefPtr<CefBrowser> browser,
|
||||
/*message_id=*/0, "Network.emulateNetworkConditions", params);
|
||||
}
|
||||
|
||||
void ClientHandler::FilterMenuModel(CefRefPtr<CefMenuModel> model) {
|
||||
// Evaluate from the bottom to the top because we'll be removing menu items.
|
||||
for (size_t x = model->GetCount(); x > 0; --x) {
|
||||
const auto i = x - 1;
|
||||
const auto type = model->GetTypeAt(i);
|
||||
if (type == MENUITEMTYPE_SUBMENU) {
|
||||
// Filter sub-menu and remove if empty.
|
||||
auto sub_model = model->GetSubMenuAt(i);
|
||||
FilterMenuModel(sub_model);
|
||||
if (sub_model->GetCount() == 0) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
} else if (type == MENUITEMTYPE_SEPARATOR) {
|
||||
// A separator shouldn't be the first or last element in the menu, and
|
||||
// there shouldn't be multiple in a row.
|
||||
if (i == 0 || i == model->GetCount() - 1 ||
|
||||
model->GetTypeAt(i + 1) == MENUITEMTYPE_SEPARATOR) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
} else if (!IsAllowedCommandId(model->GetCommandIdAt(i))) {
|
||||
model->RemoveAt(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool ClientHandler::IsAllowedCommandId(int command_id) {
|
||||
// Only the commands in this array will be allowed.
|
||||
static const int kAllowedCommandIds[] = {
|
||||
// Page navigation.
|
||||
IDC_BACK,
|
||||
IDC_FORWARD,
|
||||
IDC_RELOAD,
|
||||
IDC_RELOAD_BYPASSING_CACHE,
|
||||
IDC_RELOAD_CLEARING_CACHE,
|
||||
IDC_STOP,
|
||||
|
||||
// Printing.
|
||||
IDC_PRINT,
|
||||
|
||||
// Edit controls.
|
||||
IDC_CONTENT_CONTEXT_CUT,
|
||||
IDC_CONTENT_CONTEXT_COPY,
|
||||
IDC_CONTENT_CONTEXT_PASTE,
|
||||
IDC_CONTENT_CONTEXT_PASTE_AND_MATCH_STYLE,
|
||||
IDC_CONTENT_CONTEXT_DELETE,
|
||||
IDC_CONTENT_CONTEXT_SELECTALL,
|
||||
IDC_CONTENT_CONTEXT_UNDO,
|
||||
IDC_CONTENT_CONTEXT_REDO,
|
||||
};
|
||||
for (size_t i = 0; i < std::size(kAllowedCommandIds); ++i) {
|
||||
if (command_id == kAllowedCommandIds[i]) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace client
|
||||
|
@@ -139,6 +139,12 @@ class ClientHandler : public CefClient,
|
||||
bool OnChromeCommand(CefRefPtr<CefBrowser> browser,
|
||||
int command_id,
|
||||
cef_window_open_disposition_t disposition) override;
|
||||
bool IsChromeAppMenuItemVisible(CefRefPtr<CefBrowser> browser,
|
||||
int command_id) override;
|
||||
bool IsChromePageActionIconVisible(
|
||||
cef_chrome_page_action_icon_type_t icon_type) override;
|
||||
bool IsChromeToolbarButtonVisible(
|
||||
cef_chrome_toolbar_button_type_t button_type) override;
|
||||
|
||||
// CefContextMenuHandler methods
|
||||
void OnBeforeContextMenu(CefRefPtr<CefBrowser> browser,
|
||||
@@ -371,10 +377,6 @@ class ClientHandler : public CefClient,
|
||||
|
||||
void SetOfflineState(CefRefPtr<CefBrowser> browser, bool offline);
|
||||
|
||||
// Filter menu and keyboard shortcut commands.
|
||||
void FilterMenuModel(CefRefPtr<CefMenuModel> model);
|
||||
bool IsAllowedCommandId(int command_id);
|
||||
|
||||
// THREAD SAFE MEMBERS
|
||||
// The following members may be accessed from any thread.
|
||||
|
||||
@@ -396,6 +398,9 @@ class ClientHandler : public CefClient,
|
||||
// True if the browser is currently offline.
|
||||
bool offline_;
|
||||
|
||||
// True if the Chrome toolbar and menu contents/commands should be filtered.
|
||||
bool filter_chrome_commands_;
|
||||
|
||||
// True if Favicon images should be downloaded.
|
||||
bool download_favicon_images_ = false;
|
||||
|
||||
|
@@ -191,11 +191,12 @@ class PassThruResponseFilter : public CefResponseFilter {
|
||||
DCHECK_GT(data_out_size, 0U);
|
||||
DCHECK_EQ(data_out_written, 0U);
|
||||
|
||||
// All data will be read.
|
||||
data_in_read = data_in_size;
|
||||
|
||||
// Write out the contents unchanged.
|
||||
data_out_written = std::min(data_in_read, data_out_size);
|
||||
data_out_written = std::min(data_in_size, data_out_size);
|
||||
|
||||
// All data will be read.
|
||||
data_in_read = data_out_written;
|
||||
|
||||
if (data_out_written > 0) {
|
||||
memcpy(data_out, data_in, data_out_written);
|
||||
}
|
||||
|
@@ -28,6 +28,12 @@ RootWindowViews::~RootWindowViews() {
|
||||
REQUIRE_MAIN_THREAD();
|
||||
}
|
||||
|
||||
void RootWindowViews::SetTitlebarHeight(const std::optional<float>& height) {
|
||||
if (window_) {
|
||||
window_->SetTitlebarHeight(height);
|
||||
}
|
||||
}
|
||||
|
||||
void RootWindowViews::Init(RootWindow::Delegate* delegate,
|
||||
std::unique_ptr<RootWindowConfig> config,
|
||||
const CefBrowserSettings& settings) {
|
||||
|
@@ -26,6 +26,8 @@ class RootWindowViews : public RootWindow,
|
||||
RootWindowViews();
|
||||
~RootWindowViews();
|
||||
|
||||
void SetTitlebarHeight(const std::optional<float>& height);
|
||||
|
||||
// RootWindow methods:
|
||||
void Init(RootWindow::Delegate* delegate,
|
||||
std::unique_ptr<RootWindowConfig> config,
|
||||
|
@@ -399,6 +399,16 @@ bool ViewsWindow::GetWindowRestorePreferences(
|
||||
return true;
|
||||
}
|
||||
|
||||
void ViewsWindow::SetTitlebarHeight(const std::optional<float>& height) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
if (height.has_value()) {
|
||||
override_titlebar_height_ = height;
|
||||
} else {
|
||||
override_titlebar_height_ = default_titlebar_height_;
|
||||
}
|
||||
NudgeWindow();
|
||||
}
|
||||
|
||||
CefRefPtr<CefBrowserViewDelegate> ViewsWindow::GetDelegateForPopupBrowserView(
|
||||
CefRefPtr<CefBrowserView> browser_view,
|
||||
const CefBrowserSettings& settings,
|
||||
@@ -735,8 +745,8 @@ bool ViewsWindow::GetTitlebarHeight(CefRefPtr<CefWindow> window,
|
||||
float* titlebar_height) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
#if defined(OS_MAC)
|
||||
if (frameless_ && with_standard_buttons_) {
|
||||
*titlebar_height = kTitleBarHeight;
|
||||
if (override_titlebar_height_.has_value()) {
|
||||
*titlebar_height = override_titlebar_height_.value();
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
@@ -925,6 +935,13 @@ ViewsWindow::ViewsWindow(Delegate* delegate,
|
||||
// If window has frame or flag passed explicitly
|
||||
with_standard_buttons_ = !frameless_ || show_window_buttons;
|
||||
|
||||
#if defined(OS_MAC)
|
||||
if (frameless_ && with_standard_buttons_) {
|
||||
default_titlebar_height_ = kTitleBarHeight;
|
||||
override_titlebar_height_ = kTitleBarHeight;
|
||||
}
|
||||
#endif
|
||||
|
||||
const std::string& toolbar_type =
|
||||
command_line->GetSwitchValue(switches::kShowChromeToolbar);
|
||||
chrome_toolbar_type_ = CalculateChromeToolbarType(toolbar_type, hide_toolbar,
|
||||
@@ -1262,4 +1279,10 @@ void ViewsWindow::OnExtensionWindowClosed() {
|
||||
extension_button_pressed_lock_ = nullptr;
|
||||
}
|
||||
|
||||
#if !defined(OS_MAC)
|
||||
void ViewsWindow::NudgeWindow() {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace client
|
||||
|
@@ -130,6 +130,7 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
|
||||
bool GetWindowRestorePreferences(cef_show_state_t& show_state,
|
||||
std::optional<CefRect>& dip_bounds);
|
||||
void SetTitlebarHeight(const std::optional<float>& height);
|
||||
|
||||
// CefBrowserViewDelegate methods:
|
||||
CefRefPtr<CefBrowserViewDelegate> GetDelegateForPopupBrowserView(
|
||||
@@ -236,6 +237,8 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
const ImageCache::ImageSet& images);
|
||||
void OnExtensionWindowClosed();
|
||||
|
||||
void NudgeWindow();
|
||||
|
||||
Delegate* delegate_; // Not owned by this object.
|
||||
CefRefPtr<CefBrowserView> browser_view_;
|
||||
bool frameless_;
|
||||
@@ -258,6 +261,9 @@ class ViewsWindow : public CefBrowserViewDelegate,
|
||||
|
||||
CefRefPtr<ViewsOverlayControls> overlay_controls_;
|
||||
|
||||
std::optional<float> default_titlebar_height_;
|
||||
std::optional<float> override_titlebar_height_;
|
||||
|
||||
// Structure representing an extension.
|
||||
struct ExtensionInfo {
|
||||
ExtensionInfo(CefRefPtr<CefExtension> extension, CefRefPtr<CefImage> image)
|
||||
|
24
tests/cefclient/browser/views_window_mac.mm
Normal file
24
tests/cefclient/browser/views_window_mac.mm
Normal file
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2023 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
|
||||
#include "tests/cefclient/browser/views_window.h"
|
||||
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
namespace client {
|
||||
|
||||
void ViewsWindow::NudgeWindow() {
|
||||
if (window_) {
|
||||
auto view = CAST_CEF_WINDOW_HANDLE_TO_NSVIEW(window_->GetWindowHandle());
|
||||
NSWindow* main_window = view.window;
|
||||
|
||||
auto theme_frame = main_window.contentView.superview;
|
||||
// Nudge view frame a little to force an update.
|
||||
NSSize size = theme_frame.frame.size;
|
||||
[theme_frame setFrameSize:NSMakeSize(size.width - 1, size.height)];
|
||||
[theme_frame setFrameSize:size];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@@ -15,9 +15,7 @@
|
||||
#include "tests/cefclient/browser/test_runner.h"
|
||||
#include "tests/cefclient/browser/window_test_runner.h"
|
||||
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
#include "tests/cefclient/browser/window_test_runner_views.h"
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
#include "tests/cefclient/browser/window_test_runner_win.h"
|
||||
@@ -37,14 +35,13 @@ const char kMessagePositionName[] = "WindowTest.Position";
|
||||
const char kMessageMinimizeName[] = "WindowTest.Minimize";
|
||||
const char kMessageMaximizeName[] = "WindowTest.Maximize";
|
||||
const char kMessageRestoreName[] = "WindowTest.Restore";
|
||||
const char kMessageTitlebarHeightName[] = "WindowTest.TitlebarHeight";
|
||||
|
||||
// Create the appropriate platform test runner object.
|
||||
std::unique_ptr<WindowTestRunner> CreateWindowTestRunner() {
|
||||
#if defined(OS_WIN) || defined(OS_LINUX)
|
||||
if (MainContext::Get()->UseViews()) {
|
||||
return std::make_unique<WindowTestRunnerViews>();
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(OS_WIN)
|
||||
return std::make_unique<WindowTestRunnerWin>();
|
||||
@@ -57,6 +54,31 @@ std::unique_ptr<WindowTestRunner> CreateWindowTestRunner() {
|
||||
#endif
|
||||
}
|
||||
|
||||
// Parse the comma-delimited list of integer values.
|
||||
std::vector<int> ParsePosition(const std::string& message_name) {
|
||||
std::vector<int> vec;
|
||||
const std::string& vals = message_name.substr(sizeof(kMessagePositionName));
|
||||
std::stringstream ss(vals);
|
||||
int i;
|
||||
while (ss >> i) {
|
||||
vec.push_back(i);
|
||||
if (ss.peek() == ',') {
|
||||
ss.ignore();
|
||||
}
|
||||
}
|
||||
|
||||
return vec;
|
||||
}
|
||||
|
||||
std::optional<float> ParseHeight(const std::string& message) {
|
||||
if (message.size() > sizeof(kMessageTitlebarHeightName)) {
|
||||
const std::string& val = message.substr(sizeof(kMessageTitlebarHeightName));
|
||||
return std::stof(val);
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
// Handle messages in the browser process.
|
||||
class Handler : public CefMessageRouterBrowserSide::Handler {
|
||||
public:
|
||||
@@ -77,32 +99,19 @@ class Handler : public CefMessageRouterBrowserSide::Handler {
|
||||
|
||||
const std::string& message_name = request;
|
||||
if (message_name.find(kMessagePositionName) == 0) {
|
||||
// Parse the comma-delimited list of integer values.
|
||||
std::vector<int> vec;
|
||||
const std::string& vals =
|
||||
message_name.substr(sizeof(kMessagePositionName));
|
||||
std::stringstream ss(vals);
|
||||
int i;
|
||||
while (ss >> i) {
|
||||
vec.push_back(i);
|
||||
if (ss.peek() == ',') {
|
||||
ss.ignore();
|
||||
}
|
||||
}
|
||||
|
||||
const auto vec = ParsePosition(message_name);
|
||||
if (vec.size() == 4) {
|
||||
// Execute SetPos() on the main thread.
|
||||
runner_->SetPos(browser, vec[0], vec[1], vec[2], vec[3]);
|
||||
}
|
||||
} else if (message_name == kMessageMinimizeName) {
|
||||
// Execute Minimize() on the main thread.
|
||||
runner_->Minimize(browser);
|
||||
} else if (message_name == kMessageMaximizeName) {
|
||||
// Execute Maximize() on the main thread.
|
||||
runner_->Maximize(browser);
|
||||
} else if (message_name == kMessageRestoreName) {
|
||||
// Execute Restore() on the main thread.
|
||||
runner_->Restore(browser);
|
||||
} else if (message_name.find(kMessageTitlebarHeightName) == 0) {
|
||||
const auto height = ParseHeight(message_name);
|
||||
runner_->SetTitleBarHeight(browser, height);
|
||||
} else {
|
||||
NOTREACHED();
|
||||
}
|
||||
|
@@ -36,5 +36,10 @@ void WindowTestRunner::ModifyBounds(const CefRect& display, CefRect& window) {
|
||||
}
|
||||
}
|
||||
|
||||
void WindowTestRunner::SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
|
||||
const std::optional<float>& height) {
|
||||
NOTIMPLEMENTED();
|
||||
}
|
||||
|
||||
} // namespace window_test
|
||||
} // namespace client
|
||||
|
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "include/cef_browser.h"
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace client {
|
||||
namespace window_test {
|
||||
|
||||
@@ -15,6 +17,8 @@ namespace window_test {
|
||||
// the browser process UI thread unless otherwise indicated.
|
||||
class WindowTestRunner {
|
||||
public:
|
||||
virtual ~WindowTestRunner() = default;
|
||||
|
||||
virtual void SetPos(CefRefPtr<CefBrowser> browser,
|
||||
int x,
|
||||
int y,
|
||||
@@ -28,7 +32,8 @@ class WindowTestRunner {
|
||||
// corner of the display.
|
||||
static void ModifyBounds(const CefRect& display, CefRect& window);
|
||||
|
||||
virtual ~WindowTestRunner() {}
|
||||
virtual void SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
|
||||
const std::optional<float>& height);
|
||||
};
|
||||
|
||||
} // namespace window_test
|
||||
|
@@ -9,12 +9,15 @@
|
||||
#include "include/views/cef_window.h"
|
||||
#include "include/wrapper/cef_helpers.h"
|
||||
|
||||
#include "tests/cefclient/browser/root_window_views.h"
|
||||
#include "tests/cefclient/browser/views_window.h"
|
||||
|
||||
namespace client {
|
||||
namespace window_test {
|
||||
|
||||
namespace {
|
||||
|
||||
CefRefPtr<CefWindow> GetWindow(CefRefPtr<CefBrowser> browser) {
|
||||
CefRefPtr<CefWindow> GetWindow(const CefRefPtr<CefBrowser>& browser) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
DCHECK(browser->GetHost()->HasView());
|
||||
|
||||
@@ -27,6 +30,16 @@ CefRefPtr<CefWindow> GetWindow(CefRefPtr<CefBrowser> browser) {
|
||||
return window;
|
||||
}
|
||||
|
||||
void SetTitlebarHeight(const CefRefPtr<CefBrowser>& browser,
|
||||
const std::optional<float>& height) {
|
||||
CEF_REQUIRE_UI_THREAD();
|
||||
auto root_window = RootWindow::GetForBrowser(browser->GetIdentifier());
|
||||
DCHECK(root_window.get());
|
||||
|
||||
auto root_window_views = static_cast<RootWindowViews*>(root_window.get());
|
||||
root_window_views->SetTitlebarHeight(height);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
WindowTestRunnerViews::WindowTestRunnerViews() {}
|
||||
@@ -56,5 +69,11 @@ void WindowTestRunnerViews::Restore(CefRefPtr<CefBrowser> browser) {
|
||||
GetWindow(browser)->Restore();
|
||||
}
|
||||
|
||||
void WindowTestRunnerViews::SetTitleBarHeight(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
const std::optional<float>& height) {
|
||||
SetTitlebarHeight(browser, height);
|
||||
}
|
||||
|
||||
} // namespace window_test
|
||||
} // namespace client
|
||||
|
@@ -24,6 +24,8 @@ class WindowTestRunnerViews : public WindowTestRunner {
|
||||
void Minimize(CefRefPtr<CefBrowser> browser) override;
|
||||
void Maximize(CefRefPtr<CefBrowser> browser) override;
|
||||
void Restore(CefRefPtr<CefBrowser> browser) override;
|
||||
void SetTitleBarHeight(CefRefPtr<CefBrowser> browser,
|
||||
const std::optional<float>& height) override;
|
||||
};
|
||||
|
||||
} // namespace window_test
|
||||
|
@@ -568,7 +568,7 @@ function onUnload() {
|
||||
Status information and messages will be displayed in the center of the screen.
|
||||
After creating a route you can send messages to the receiver app using the textarea at the bottom of the screen.
|
||||
Messages are usually in JSON format with a example of Cast communication to be found
|
||||
<a href="https://bitbucket.org/chromiumembedded/cef/issues/2900/add-mediarouter-support-for-cast-receiver#comment-56680326" target="_blank">here</a>.
|
||||
<a href="https://github.com/chromiumembedded/cef/issues/2900#issuecomment-1465022620" target="_blank">here</a>.
|
||||
</p>
|
||||
</div>
|
||||
<div class="route_controls">
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US">
|
||||
<head>
|
||||
<title>Window Test</title>
|
||||
<script>
|
||||
@@ -47,6 +48,14 @@ function position() {
|
||||
else
|
||||
send_message('Position', x + ',' + y + ',' + width + ',' + height);
|
||||
}
|
||||
|
||||
function setTitlebarHeight() {
|
||||
const height = parseFloat(document.getElementById('title_bar_height').value);
|
||||
if (isNaN(height))
|
||||
send_message('TitlebarHeight');
|
||||
else
|
||||
send_message('TitlebarHeight', height);
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body bgcolor="white" onload="setup()">
|
||||
@@ -60,6 +69,8 @@ X: <input type="text" size="4" id="x" value="200">
|
||||
Y: <input type="text" size="4" id="y" value="100">
|
||||
Width: <input type="text" size="4" id="width" value="800">
|
||||
Height: <input type="text" size="4" id="height" value="600">
|
||||
<br/><input type="button" onclick="setTitlebarHeight();" value="Set Titlebar Height">
|
||||
<input type="number" min="0" max="100" id="title_bar_height" value="50"> (works on macOS with Views)
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -53,7 +53,7 @@ void ClientAppBrowser::OnBeforeCommandLineProcessing(
|
||||
// Use software rendering and compositing (disable GPU) for increased FPS
|
||||
// and decreased CPU usage. This will also disable WebGL so remove these
|
||||
// switches if you need that capability.
|
||||
// See https://bitbucket.org/chromiumembedded/cef/issues/1257 for details.
|
||||
// See https://github.com/chromiumembedded/cef/issues/1257 for details.
|
||||
if (!command_line->HasSwitch(switches::kEnableGPU)) {
|
||||
command_line->AppendSwitch("disable-gpu");
|
||||
command_line->AppendSwitch("disable-gpu-compositing");
|
||||
|
@@ -29,6 +29,7 @@ const char kSharedTextureEnabled[] = "shared-texture-enabled";
|
||||
const char kExternalBeginFrameEnabled[] = "external-begin-frame-enabled";
|
||||
const char kMouseCursorChangeDisabled[] = "mouse-cursor-change-disabled";
|
||||
const char kOffline[] = "offline";
|
||||
const char kFilterChromeCommands[] = "filter-chrome-commands";
|
||||
const char kRequestContextPerBrowser[] = "request-context-per-browser";
|
||||
const char kRequestContextSharedCache[] = "request-context-shared-cache";
|
||||
const char kBackgroundColor[] = "background-color";
|
||||
|
@@ -23,6 +23,7 @@ extern const char kSharedTextureEnabled[];
|
||||
extern const char kExternalBeginFrameEnabled[];
|
||||
extern const char kMouseCursorChangeDisabled[];
|
||||
extern const char kOffline[];
|
||||
extern const char kFilterChromeCommands[];
|
||||
extern const char kRequestContextPerBrowser[];
|
||||
extern const char kRequestContextSharedCache[];
|
||||
extern const char kBackgroundColor[];
|
||||
|
@@ -111,7 +111,7 @@ if platform == 'windows':
|
||||
# installed (e.g. not discoverable via the Windows registry) then
|
||||
# "%GYP_MSVS_OVERRIDE_PATH%\Common7\Tools\vsdevcmd\core\winsdk.bat" must be
|
||||
# patched to support discovery via SDK_ROOT as described in
|
||||
# https://bitbucket.org/chromiumembedded/cef/issues/2773#comment-59687474.
|
||||
# https://github.com/chromiumembedded/cef/issues/2773#issuecomment-1465019898.
|
||||
#
|
||||
if bool(int(os.environ.get('WIN_CUSTOM_TOOLCHAIN', '0'))):
|
||||
required_vars = [
|
||||
|
@@ -226,7 +226,7 @@ def GetRecommendedDefaultArgs():
|
||||
|
||||
# Disable V8 sandboxed pointers to avoid crashing when using
|
||||
# CefV8Value::CreateArrayBuffer with memory allocated outside of the V8
|
||||
# sandbox. See https://bitbucket.org/chromiumembedded/cef/issues/3332.
|
||||
# sandbox. See https://github.com/chromiumembedded/cef/issues/3332.
|
||||
'v8_enable_sandbox': False,
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ def GetRecommendedDefaultArgs():
|
||||
if platform != 'windows':
|
||||
# Only allow non-component Debug builds on non-Windows platforms. These
|
||||
# builds will fail on Windows due to linker issues (running out of memory,
|
||||
# etc). See https://bitbucket.org/chromiumembedded/cef/issues/2679.
|
||||
# etc). See https://github.com/chromiumembedded/cef/issues/2679.
|
||||
result['forbid_non_component_debug_builds'] = False
|
||||
|
||||
if platform == 'linux':
|
||||
|
@@ -4,7 +4,7 @@
|
||||
#
|
||||
# Resort order of object files in libcef.ninja file.
|
||||
#
|
||||
# See: https://bitbucket.org/chromiumembedded/cef/issues/1999
|
||||
# See: https://github.com/chromiumembedded/cef/issues/1999
|
||||
#
|
||||
# Usage:
|
||||
# import issue_1999
|
||||
|
Reference in New Issue
Block a user