Update to Chromium version 127.0.6533.0 (#1313161)

This commit is contained in:
Marshall Greenblatt
2024-06-14 13:01:45 -04:00
parent 4ed13d8c47
commit c44aa35bfc
144 changed files with 877 additions and 910 deletions

View File

@@ -34,6 +34,7 @@
#include "cef/libcef/features/runtime.h"
#include "chrome/browser/file_select_helper.h"
#include "chrome/browser/picture_in_picture/picture_in_picture_window_manager.h"
#include "components/input/native_web_keyboard_event.h"
#include "components/zoom/page_zoom.h"
#include "content/browser/gpu/compositor_util.h"
#include "content/public/browser/desktop_media_id.h"
@@ -46,7 +47,6 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/constants.h"
#include "net/base/net_errors.h"
@@ -1084,13 +1084,13 @@ void AlloyBrowserHostImpl::CanDownload(
KeyboardEventProcessingResult AlloyBrowserHostImpl::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
return contents_delegate_->PreHandleKeyboardEvent(source, event);
}
bool AlloyBrowserHostImpl::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// Check to see if event should be ignored.
if (event.skip_if_unhandled) {
return false;
@@ -1297,7 +1297,8 @@ void AlloyBrowserHostImpl::ExitPictureInPicture() {
PictureInPictureWindowManager::GetInstance()->ExitPictureInPicture();
}
bool AlloyBrowserHostImpl::IsBackForwardCacheSupported() {
bool AlloyBrowserHostImpl::IsBackForwardCacheSupported(
content::WebContents& web_contents) {
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
return true;
#else

View File

@@ -222,10 +222,9 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
base::OnceCallback<void(bool)> callback) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
const input::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(content::WebContents* source,
const input::NativeWebKeyboardEvent& event) override;
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
bool PreHandleGestureEvent(content::WebContents* source,
const blink::WebGestureEvent& event) override;
@@ -289,7 +288,7 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
content::PictureInPictureResult EnterPictureInPicture(
content::WebContents* web_contents) override;
void ExitPictureInPicture() override;
bool IsBackForwardCacheSupported() override;
bool IsBackForwardCacheSupported(content::WebContents& web_contents) override;
content::PreloadingEligibility IsPrerender2Supported(
content::WebContents& web_contents) override;
void DraggableRegionsChanged(

View File

@@ -361,10 +361,15 @@ const extensions::Extension* GetEnabledExtensionFromSiteURL(
std::unique_ptr<blink::URLLoaderThrottle> CreateGoogleURLLoaderThrottle(
Profile* profile) {
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
std::vector<chrome::mojom::BoundSessionThrottlerParamsPtr>
bound_session_throttler_params;
#endif
chrome::mojom::DynamicParamsPtr dynamic_params =
chrome::mojom::DynamicParams::New(
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
/*bound_session_params=*/nullptr,
std::move(bound_session_throttler_params),
#endif
profile->GetPrefs()->GetBoolean(
policy::policy_prefs::kForceGoogleSafeSearch),

View File

@@ -18,7 +18,6 @@
#include "cef/libcef/common/cef_switches.h"
#include "cef/libcef/common/extensions/extensions_client.h"
#include "cef/libcef/common/extensions/extensions_util.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/component_updater/chrome_component_updater_configurator.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/permissions/chrome_permissions_client.h"
@@ -92,16 +91,12 @@ void ChromeBrowserProcessAlloy::OnContextInitialized() {
providers;
#if BUILDFLAG(IS_WIN)
// TODO(crbug.com/1373092): For Windows, continue to add providers behind
// features, as support for them is added.
if (base::FeatureList::IsEnabled(features::kEnableDPAPIEncryptionProvider)) {
// The DPAPI key provider requires OSCrypt::Init to have already been called
// to initialize the key storage. This happens in
// AlloyBrowserMainParts::PreCreateMainMessageLoop.
providers.emplace_back(std::make_pair(
/*precedence=*/10u,
std::make_unique<os_crypt_async::DPAPIKeyProvider>(local_state())));
}
// The DPAPI key provider requires OSCrypt::Init to have already been called
// to initialize the key storage. This happens in
// AlloyBrowserMainParts::PreCreateMainMessageLoop.
providers.emplace_back(std::make_pair(
/*precedence=*/10u,
std::make_unique<os_crypt_async::DPAPIKeyProvider>(local_state())));
#endif // BUILDFLAG(IS_WIN)
os_crypt_async_ =

View File

@@ -37,30 +37,17 @@ class CefVariationsClient : public variations::VariationsClient {
} // namespace
ChromeProfileAlloy::ChromeProfileAlloy() {
ChromeProfileAlloy::ChromeProfileAlloy() : Profile(nullptr) {
// Alloy contexts are never flagged as off-the-record. It causes problems
// for the extension system.
DCHECK(!IsOffTheRecord());
profile_metrics::SetBrowserProfileType(
this, profile_metrics::BrowserProfileType::kRegular);
}
ChromeProfileAlloy::~ChromeProfileAlloy() = default;
bool ChromeProfileAlloy::IsOffTheRecord() {
return false;
}
bool ChromeProfileAlloy::IsOffTheRecord() const {
// Alloy contexts are never flagged as off-the-record. It causes problems
// for the extension system.
return false;
}
const Profile::OTRProfileID& ChromeProfileAlloy::GetOTRProfileID() const {
DCHECK(false);
static base::NoDestructor<Profile::OTRProfileID> otr_profile_id(
Profile::OTRProfileID::PrimaryID());
return *otr_profile_id;
}
variations::VariationsClient* ChromeProfileAlloy::GetVariationsClient() {
if (!variations_client_) {
variations_client_ = std::make_unique<CefVariationsClient>(this);

View File

@@ -25,9 +25,6 @@ class ChromeProfileAlloy : public Profile {
protected:
// Profile methods.
bool IsOffTheRecord() override;
bool IsOffTheRecord() const override;
const OTRProfileID& GetOTRProfileID() const override;
variations::VariationsClient* GetVariationsClient() override;
scoped_refptr<base::SequencedTaskRunner> GetIOTaskRunner() override;
std::string GetProfileUserName() const override;

View File

@@ -495,6 +495,9 @@ void CefDevToolsFrontend::HandleMessageFromDevToolsFrontend(
url_loader_factory.get(), request_id);
loaders_.insert(std::move(resource_loader));
return;
} else if (*method == "getHostConfig") {
SendMessageAck(request_id, {});
return;
} else if (*method == "getPreferences") {
SendMessageAck(request_id,
GetPrefs()->GetDict(prefs::kDevToolsPreferences).Clone());

View File

@@ -12,6 +12,7 @@
#include "cef/libcef/common/frame_util.h"
#include "chrome/browser/ui/views/sad_tab_view.h"
#include "chrome/common/chrome_result_codes.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/focused_node_details.h"
#include "content/public/browser/keyboard_event_processing_result.h"
@@ -21,7 +22,6 @@
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_observer.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/mojom/favicon/favicon_url.mojom.h"
#include "third_party/blink/public/mojom/input/focus_type.mojom-blink.h"
@@ -247,7 +247,7 @@ void CefBrowserContentsDelegate::CanDownload(
KeyboardEventProcessingResult
CefBrowserContentsDelegate::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
if (auto delegate = platform_delegate()) {
if (auto c = client()) {
if (auto handler = c->GetKeyboardHandler()) {
@@ -274,7 +274,7 @@ CefBrowserContentsDelegate::PreHandleKeyboardEvent(
bool CefBrowserContentsDelegate::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// Check to see if event should be ignored.
if (event.skip_if_unhandled) {
return false;

View File

@@ -105,10 +105,9 @@ class CefBrowserContentsDelegate : public content::WebContentsDelegate,
base::OnceCallback<void(bool)> callback) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
const input::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(content::WebContents* source,
const input::NativeWebKeyboardEvent& event) override;
void DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) override;

View File

@@ -590,7 +590,7 @@ CefBrowserInfo::NotificationStateLock::NotificationStateLock(
// Take the browser info state lock.
browser_info_lock_scope_ =
std::make_unique<base::AutoLock>(browser_info_->lock_);
std::make_unique<base::MovableAutoLock>(browser_info_->lock_);
}
CefBrowserInfo::NotificationStateLock::~NotificationStateLock() {

View File

@@ -221,7 +221,7 @@ class CefBrowserInfo : public base::RefCountedThreadSafe<CefBrowserInfo> {
friend class CefBrowserInfo;
const raw_ptr<CefBrowserInfo> browser_info_;
CefRefPtr<CefFrameHandler> frame_handler_;
std::unique_ptr<base::AutoLock> browser_info_lock_scope_;
std::unique_ptr<base::MovableAutoLock> browser_info_lock_scope_;
std::queue<FrameNotifyOnceAction> queue_;
};

View File

@@ -34,10 +34,7 @@ class MessagePumpExternal : public base::MessagePumpForUI {
#endif
base::TimeTicks next_run_time; // is_null()
const bool has_more_work = DirectRunWork(delegate, &next_run_time);
if (!has_more_work) {
break;
}
DirectRunWork(delegate, &next_run_time);
if (next_run_time.is_null()) {
// We have more work that should run immediately.
@@ -63,10 +60,9 @@ class MessagePumpExternal : public base::MessagePumpForUI {
}
private:
static bool DirectRunWork(Delegate* delegate,
static void DirectRunWork(Delegate* delegate,
base::TimeTicks* next_run_time) {
bool more_immediate_work = false;
bool more_idle_work = false;
bool more_delayed_work = false;
Delegate::NextWorkInfo next_work_info = delegate->DoWork();
@@ -85,11 +81,8 @@ class MessagePumpExternal : public base::MessagePumpForUI {
}
if (!more_immediate_work && !more_delayed_work) {
// DoIdleWork() returns true if idle work was all done.
more_idle_work = !delegate->DoIdleWork();
delegate->DoIdleWork();
}
return more_immediate_work || more_idle_work || more_delayed_work;
}
const float max_time_slice_;

View File

@@ -345,7 +345,7 @@ void CefBrowserPlatformDelegate::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegate::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
DCHECK(false);
return false;
}
@@ -369,7 +369,7 @@ void CefBrowserPlatformDelegate::HandleExternalProtocol(const GURL& url) {
}
CefEventHandle CefBrowserPlatformDelegate::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
DCHECK(false);
return kNullEventHandle;
}

View File

@@ -42,7 +42,6 @@ class WindowFeatures;
namespace content {
struct DropData;
struct NativeWebKeyboardEvent;
class RenderViewHost;
class RenderViewHostDelegateView;
class RenderWidgetHostImpl;
@@ -65,6 +64,10 @@ class Size;
class Vector2d;
} // namespace gfx
namespace input {
struct NativeWebKeyboardEvent;
}
namespace ui {
struct AXLocationChanges;
struct AXUpdatesAndEvents;
@@ -288,8 +291,7 @@ class CefBrowserPlatformDelegate {
// Forward the keyboard event to the application or frame window to allow
// processing of shortcut keys.
virtual bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event);
virtual bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event);
#if BUILDFLAG(ENABLE_ALLOY_BOOTSTRAP)
// See WebContentsDelegate documentation.
@@ -305,7 +307,7 @@ class CefBrowserPlatformDelegate {
// Returns the OS event handle, if any, associated with |event|.
virtual CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const;
const input::NativeWebKeyboardEvent& event) const;
// Create the platform-specific JavaScript dialog runner.
virtual std::unique_ptr<CefJavaScriptDialogRunner>

View File

@@ -4,11 +4,11 @@
#include "cef/libcef/browser/browser_util.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "components/input/native_web_keyboard_event.h"
namespace browser_util {
bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
bool GetCefKeyEvent(const input::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event) {
switch (event.GetType()) {
case blink::WebKeyboardEvent::Type::kRawKeyDown:
@@ -66,7 +66,7 @@ bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
}
bool GetCefKeyEvent(const ui::KeyEvent& event, CefKeyEvent& cef_event) {
content::NativeWebKeyboardEvent native_event(event);
input::NativeWebKeyboardEvent native_event(event);
return GetCefKeyEvent(native_event, cef_event);
}

View File

@@ -8,7 +8,7 @@
#include "cef/include/internal/cef_types_wrappers.h"
namespace content {
namespace input {
struct NativeWebKeyboardEvent;
}
@@ -18,8 +18,8 @@ class KeyEvent;
namespace browser_util {
// Convert a content::NativeWebKeyboardEvent to a CefKeyEvent.
bool GetCefKeyEvent(const content::NativeWebKeyboardEvent& event,
// Convert a input::NativeWebKeyboardEvent to a CefKeyEvent.
bool GetCefKeyEvent(const input::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event);
// Convert a ui::KeyEvent to a CefKeyEvent.

View File

@@ -114,7 +114,7 @@ void CefBrowserPlatformDelegateChrome::ViewText(const std::string& text) {
}
CefEventHandle CefBrowserPlatformDelegateChrome::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
return native_delegate_->GetEventHandle(event);
}

View File

@@ -42,7 +42,7 @@ class CefBrowserPlatformDelegateChrome
bool want_dip_coords) const override;
void ViewText(const std::string& text) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
bool IsAlloyStyle() const override { return false; }
// CefBrowserPlatformDelegateNative::WindowlessHandler methods:

View File

@@ -25,12 +25,12 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_tabstrip.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/public/browser/global_routing_id.h"
#include "content/public/browser/keyboard_event_processing_result.h"
#include "content/public/browser/navigation_handle.h"
#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "third_party/blink/public/mojom/page/draggable_region.mojom.h"
using content::KeyboardEventProcessingResult;
@@ -631,7 +631,7 @@ ChromeBrowserDelegate::GetJavaScriptDialogManager(
KeyboardEventProcessingResult ChromeBrowserDelegate::PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
if (auto delegate = GetDelegateForWebContents(source)) {
return delegate->PreHandleKeyboardEvent(source, event);
}
@@ -640,7 +640,7 @@ KeyboardEventProcessingResult ChromeBrowserDelegate::PreHandleKeyboardEvent(
bool ChromeBrowserDelegate::HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
if (auto delegate = GetDelegateForWebContents(source)) {
return delegate->HandleKeyboardEvent(source, event);
}

View File

@@ -122,10 +122,9 @@ class ChromeBrowserDelegate : public cef::BrowserDelegate {
content::WebContents* source) override;
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(
content::WebContents* source,
const content::NativeWebKeyboardEvent& event) override;
const input::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(content::WebContents* source,
const input::NativeWebKeyboardEvent& event) override;
void DraggableRegionsChanged(
const std::vector<blink::mojom::DraggableRegionPtr>& regions,
content::WebContents* contents) override;

View File

@@ -93,13 +93,13 @@ void CefBrowserPlatformDelegateBackground::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateBackground::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// Nothing to do here.
return false;
}
CefEventHandle CefBrowserPlatformDelegateBackground::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
return native_delegate_->GetEventHandle(event);
}

View File

@@ -37,10 +37,9 @@ class CefBrowserPlatformDelegateBackground
gfx::Point GetScreenPoint(const gfx::Point& view,
bool want_dip_coords) const override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
// CefBrowserPlatformDelegateNative::WindowlessHandler methods:

View File

@@ -40,7 +40,6 @@ const char* const kSupportedAPIs[] = {
ContentSettingsContentSettingGetResourceIdentifiersFunction),
"pdfViewerPrivate",
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsAllowedLocalFileAccessFunction),
EXTENSION_FUNCTION_NAME(PdfViewerPrivateIsPdfOcrAlwaysActiveFunction),
"resourcesPrivate",
EXTENSION_FUNCTION_NAME(ResourcesPrivateGetStringsFunction),
"storage",
@@ -89,7 +88,6 @@ void ChromeFunctionRegistry::RegisterAll(ExtensionFunctionRegistry* registry) {
ContentSettingsContentSettingGetResourceIdentifiersFunction>();
registry
->RegisterFunction<PdfViewerPrivateIsAllowedLocalFileAccessFunction>();
registry->RegisterFunction<PdfViewerPrivateIsPdfOcrAlwaysActiveFunction>();
registry->RegisterFunction<ResourcesPrivateGetStringsFunction>();
registry->RegisterFunction<StorageStorageAreaGetFunction>();
registry->RegisterFunction<StorageStorageAreaSetFunction>();

View File

@@ -10,10 +10,10 @@
#include "extensions/browser/process_util.h"
#include "third_party/blink/public/common/input/web_gesture_event.h"
using content::NativeWebKeyboardEvent;
using content::OpenURLParams;
using content::WebContents;
using content::WebContentsObserver;
using input::NativeWebKeyboardEvent;
namespace extensions {

View File

@@ -34,7 +34,7 @@ class CefBrowserPlatformDelegateNative
void WasResized() override;
// Translate CEF events to Chromium/Blink Web events.
virtual content::NativeWebKeyboardEvent TranslateWebKeyEvent(
virtual input::NativeWebKeyboardEvent TranslateWebKeyEvent(
const CefKeyEvent& key_event) const = 0;
virtual blink::WebMouseEvent TranslateWebClickEvent(
const CefMouseEvent& mouse_event,

View File

@@ -101,10 +101,10 @@ gfx::Point CefBrowserPlatformDelegateNativeAura::GetScreenPoint(
return screen_pt;
}
content::NativeWebKeyboardEvent
input::NativeWebKeyboardEvent
CefBrowserPlatformDelegateNativeAura::TranslateWebKeyEvent(
const CefKeyEvent& key_event) const {
return content::NativeWebKeyboardEvent(TranslateUiKeyEvent(key_event));
return input::NativeWebKeyboardEvent(TranslateUiKeyEvent(key_event));
}
blink::WebMouseEvent

View File

@@ -41,7 +41,7 @@ class CefBrowserPlatformDelegateNativeAura
bool want_dip_coords) const override;
// CefBrowserPlatformDelegateNative methods:
content::NativeWebKeyboardEvent TranslateWebKeyEvent(
input::NativeWebKeyboardEvent TranslateWebKeyEvent(
const CefKeyEvent& key_event) const override;
blink::WebMouseEvent TranslateWebClickEvent(
const CefMouseEvent& mouse_event,

View File

@@ -9,9 +9,9 @@
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/native/window_delegate_view.h"
#include "cef/libcef/browser/thread_util.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "third_party/blink/public/mojom/renderer_preferences.mojom.h"
#include "ui/events/keycodes/dom/dom_key.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
@@ -227,13 +227,13 @@ void CefBrowserPlatformDelegateNativeLinux::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateNativeLinux::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// TODO(cef): Is something required here to handle shortcut keys?
return false;
}
CefEventHandle CefBrowserPlatformDelegateNativeLinux::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
// TODO(cef): We need to return an XEvent* from this method, but
// |event.os_event->native_event()| now returns a ui::Event* instead.
// See https://crbug.com/965991.
@@ -285,12 +285,12 @@ ui::KeyEvent CefBrowserPlatformDelegateNativeLinux::TranslateUiKeyEvent(
return ui::KeyEvent(type, key_code, dom_code, flags, dom_key, time_stamp);
}
content::NativeWebKeyboardEvent
input::NativeWebKeyboardEvent
CefBrowserPlatformDelegateNativeLinux::TranslateWebKeyEvent(
const CefKeyEvent& key_event) const {
ui::KeyEvent ui_event = TranslateUiKeyEvent(key_event);
if (key_event.type == KEYEVENT_CHAR) {
return content::NativeWebKeyboardEvent(ui_event, key_event.character);
return input::NativeWebKeyboardEvent(ui_event, key_event.character);
}
return content::NativeWebKeyboardEvent(ui_event);
return input::NativeWebKeyboardEvent(ui_event);
}

View File

@@ -30,14 +30,13 @@ class CefBrowserPlatformDelegateNativeLinux
void NotifyMoveOrResizeStarted() override;
void SizeTo(int width, int height) override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
// CefBrowserPlatformDelegateNativeAura methods:
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;
content::NativeWebKeyboardEvent TranslateWebKeyEvent(
input::NativeWebKeyboardEvent TranslateWebKeyEvent(
const CefKeyEvent& key_event) const override;
private:

View File

@@ -43,17 +43,16 @@ class CefBrowserPlatformDelegateNativeMac
gfx::Point GetScreenPoint(const gfx::Point& view,
bool want_dip_coords) const override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner()
override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
bool IsPrintPreviewSupported() const override;
// CefBrowserPlatformDelegateNative methods:
content::NativeWebKeyboardEvent TranslateWebKeyEvent(
input::NativeWebKeyboardEvent TranslateWebKeyEvent(
const CefKeyEvent& key_event) const override;
blink::WebMouseEvent TranslateWebClickEvent(
const CefMouseEvent& mouse_event,

View File

@@ -17,10 +17,10 @@
#include "cef/libcef/browser/native/javascript_dialog_runner_mac.h"
#include "cef/libcef/browser/native/menu_runner_mac.h"
#include "cef/libcef/browser/thread_util.h"
#include "components/input/native_web_keyboard_event.h"
#include "content/browser/renderer_host/render_widget_host_view_mac.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
@@ -360,7 +360,7 @@ void CefBrowserPlatformDelegateNativeMac::SendKeyEvent(
return;
}
content::NativeWebKeyboardEvent web_event = TranslateWebKeyEvent(event);
input::NativeWebKeyboardEvent web_event = TranslateWebKeyEvent(event);
view->ForwardKeyboardEvent(web_event, ui::LatencyInfo());
}
@@ -450,7 +450,7 @@ void CefBrowserPlatformDelegateNativeMac::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateNativeMac::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// Give the top level menu equivalents a chance to handle the event.
NSEvent* ns_event = event.os_event.Get();
if (ns_event.type == NSEventTypeKeyDown) {
@@ -460,7 +460,7 @@ bool CefBrowserPlatformDelegateNativeMac::HandleKeyboardEvent(
}
CefEventHandle CefBrowserPlatformDelegateNativeMac::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
return CAST_NSEVENT_TO_CEF_EVENT_HANDLE(event.os_event.Get());
}
@@ -481,10 +481,10 @@ bool CefBrowserPlatformDelegateNativeMac::IsPrintPreviewSupported() const {
return false;
}
content::NativeWebKeyboardEvent
input::NativeWebKeyboardEvent
CefBrowserPlatformDelegateNativeMac::TranslateWebKeyEvent(
const CefKeyEvent& key_event) const {
content::NativeWebKeyboardEvent result(
input::NativeWebKeyboardEvent result(
blink::WebInputEvent::Type::kUndefined,
blink::WebInputEvent::Modifiers::kNoModifiers, ui::EventTimeForNow());
@@ -533,8 +533,8 @@ CefBrowserPlatformDelegateNativeMac::TranslateWebKeyEvent(
isARepeat:NO
keyCode:key_event.native_key_code];
result = content::NativeWebKeyboardEvent(
base::apple::OwnedNSEvent(synthetic_event));
result =
input::NativeWebKeyboardEvent(base::apple::OwnedNSEvent(synthetic_event));
if (key_event.type == KEYEVENT_CHAR) {
result.SetType(blink::WebInputEvent::Type::kChar);
}

View File

@@ -18,7 +18,7 @@
#include "cef/libcef/browser/geometry_util.h"
#include "cef/libcef/browser/native/window_delegate_view.h"
#include "cef/libcef/browser/thread_util.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "components/input/native_web_keyboard_event.h"
#include "third_party/blink/public/common/input/web_mouse_event.h"
#include "third_party/blink/public/common/input/web_mouse_wheel_event.h"
#include "ui/aura/window.h"
@@ -375,7 +375,7 @@ void CefBrowserPlatformDelegateNativeWin::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// Any unhandled keyboard/character messages are sent to DefWindowProc so that
// shortcut keys work correctly.
if (event.os_event) {
@@ -409,7 +409,7 @@ bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
UINT scan_code = ::MapVirtualKeyW(event.windows_key_code, MAPVK_VK_TO_VSC);
msg.lParam = (scan_code << 16) | // key scan code
1; // key repeat count
if (event.GetModifiers() & content::NativeWebKeyboardEvent::kAltKey) {
if (event.GetModifiers() & input::NativeWebKeyboardEvent::kAltKey) {
msg.lParam |= (1 << 29);
}
@@ -418,7 +418,7 @@ bool CefBrowserPlatformDelegateNativeWin::HandleKeyboardEvent(
}
CefEventHandle CefBrowserPlatformDelegateNativeWin::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
if (!event.os_event) {
return nullptr;
}

View File

@@ -29,10 +29,9 @@ class CefBrowserPlatformDelegateNativeWin
void NotifyMoveOrResizeStarted() override;
void SizeTo(int width, int height) override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
// CefBrowserPlatformDelegateNativeAura methods:
ui::KeyEvent TranslateUiKeyEvent(const CefKeyEvent& key_event) const override;

View File

@@ -37,7 +37,8 @@ void CefWindowDelegateView::Init(gfx::AcceleratedWidget parent_widget,
// See CalculateWindowStylesFromInitParams in
// ui/views/widget/widget_hwnd_utils.cc for the conversion of |params| to
// Windows style flags.
views::Widget::InitParams params;
views::Widget::InitParams params(
views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
params.parent_widget = parent_widget;
params.bounds = bounds;
params.delegate = this;

View File

@@ -301,8 +301,7 @@ void SaveCookies(const CefBrowserContext::Getter& browser_context_getter,
std::unique_ptr<net::CanonicalCookie> cookie = net::CanonicalCookie::Create(
request.url, cookie_string, base::Time::Now(),
std::make_optional(response_date),
/*cookie_partition_key=*/std::nullopt,
/*block_truncated=*/true, net::CookieSourceType::kHTTP,
/*cookie_partition_key=*/std::nullopt, net::CookieSourceType::kHTTP,
&returned_status);
if (!returned_status.IsInclude()) {
continue;

View File

@@ -14,8 +14,8 @@
#include "cef/libcef/browser/osr/web_contents_view_osr.h"
#include "cef/libcef/browser/views/view_util.h"
#include "cef/libcef/common/drag_data_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/browser/web_contents/web_contents_impl.h"
#include "content/common/input/render_widget_host_input_event_router.h"
#include "content/public/browser/render_view_host.h"
#include "ui/display/screen.h"
#include "ui/events/base_event_utils.h"
@@ -109,7 +109,7 @@ void CefBrowserPlatformDelegateOsr::SendKeyEvent(const CefKeyEvent& event) {
return;
}
content::NativeWebKeyboardEvent web_event =
input::NativeWebKeyboardEvent web_event =
native_delegate_->TranslateWebKeyEvent(event);
view->SendKeyEvent(web_event);
}
@@ -200,12 +200,12 @@ void CefBrowserPlatformDelegateOsr::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateOsr::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
return native_delegate_->HandleKeyboardEvent(event);
}
CefEventHandle CefBrowserPlatformDelegateOsr::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
return native_delegate_->GetEventHandle(event);
}

View File

@@ -47,10 +47,9 @@ class CefBrowserPlatformDelegateOsr
gfx::Point GetScreenPoint(const gfx::Point& view,
bool want_dip_coords) const override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
std::unique_ptr<CefJavaScriptDialogRunner> CreateJavaScriptDialogRunner()
override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;

View File

@@ -30,15 +30,15 @@
#include "components/viz/common/switches.h"
#include "content/browser/bad_message.h"
#include "content/browser/gpu/gpu_data_manager_impl.h"
#include "content/browser/renderer_host/cursor_manager.h"
#include "content/browser/renderer_host/delegated_frame_host.h"
#include "content/browser/renderer_host/dip_util.h"
#include "content/browser/renderer_host/input/motion_event_web.h"
#include "content/browser/renderer_host/input/synthetic_gesture_target_base.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
#include "content/browser/renderer_host/render_widget_host_impl.h"
#include "content/browser/renderer_host/render_widget_host_input_event_router.h"
#include "content/common/content_switches_internal.h"
#include "content/common/input/cursor_manager.h"
#include "content/common/input/render_widget_host_input_event_router.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/context_factory.h"
@@ -1186,7 +1186,7 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() {
}
void CefRenderWidgetHostViewOSR::SendKeyEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
TRACE_EVENT0("cef", "CefRenderWidgetHostViewOSR::SendKeyEvent");
content::RenderWidgetHostImpl* target_host = render_widget_host_;
@@ -1415,8 +1415,8 @@ void CefRenderWidgetHostViewOSR::SendTouchEvent(const CefTouchEvent& event) {
render_widget_host_->delegate()->GetInputEventRouter()->RouteTouchEvent(
this, &touch_event, latency_info);
} else {
render_widget_host_->ForwardTouchEventWithLatencyInfo(touch_event,
latency_info);
render_widget_host_->GetRenderInputRouter()
->ForwardTouchEventWithLatencyInfo(touch_event, latency_info);
}
bool touch_end =
@@ -1495,7 +1495,7 @@ void CefRenderWidgetHostViewOSR::OnUpdateTextInputStateCalled(
}
void CefRenderWidgetHostViewOSR::ProcessAckedTouchEvent(
const content::TouchEventWithLatencyInfo& touch,
const input::TouchEventWithLatencyInfo& touch,
blink::mojom::InputEventResultState ack_result) {
const bool event_consumed =
ack_result == blink::mojom::InputEventResultState::kConsumed;

View File

@@ -228,7 +228,7 @@ class CefRenderWidgetHostViewOSR
// ui::GestureProviderClient implementation.
void ProcessAckedTouchEvent(
const content::TouchEventWithLatencyInfo& touch,
const input::TouchEventWithLatencyInfo& touch,
blink::mojom::InputEventResultState ack_result) override;
void OnGestureEvent(const ui::GestureEventData& gesture) override;
@@ -241,7 +241,7 @@ class CefRenderWidgetHostViewOSR
void OnScreenInfoChanged();
void Invalidate(CefBrowserHost::PaintElementType type);
void SendExternalBeginFrame();
void SendKeyEvent(const content::NativeWebKeyboardEvent& event);
void SendKeyEvent(const input::NativeWebKeyboardEvent& event);
void SendMouseEvent(const blink::WebMouseEvent& event);
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
void SendTouchEvent(const CefTouchEvent& event);

View File

@@ -311,11 +311,6 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
registry->RegisterBooleanPref(
prefs::kAccessControlAllowMethodsInCORSPreflightSpecConformant, true);
// Based on browser_prefs::RegisterProfilePrefs.
registry->RegisterBooleanPref(prefs::kAccessibilityPdfOcrAlwaysActive,
false);
registry->RegisterBooleanPref(prefs::kBlockTruncatedCookies, true);
// Spell checking preferences.
// Modify defaults from SpellcheckServiceFactory::RegisterProfilePrefs.
std::string spellcheck_lang =

View File

@@ -86,7 +86,7 @@ PersistentPrefStore::PrefReadError CefPrefStore::ReadPrefs() {
void CefPrefStore::ReadPrefsAsync(ReadErrorDelegate* error_delegate) {
DCHECK(!pending_async_read_);
error_delegate_.reset(error_delegate);
error_delegate_.emplace(error_delegate);
if (block_async_read_) {
pending_async_read_ = true;
} else {
@@ -106,6 +106,10 @@ void CefPrefStore::SchedulePendingLossyWrites() {}
void CefPrefStore::OnStoreDeletionFromDisk() {}
bool CefPrefStore::HasReadErrorDelegate() const {
return error_delegate_.has_value();
}
void CefPrefStore::SetInitializationCompleted() {
NotifyInitializationCompleted();
}
@@ -119,8 +123,9 @@ void CefPrefStore::NotifyPrefValueChanged(const std::string& key) {
void CefPrefStore::NotifyInitializationCompleted() {
DCHECK(!init_complete_);
init_complete_ = true;
if (read_success_ && read_error_ != PREF_READ_ERROR_NONE && error_delegate_) {
error_delegate_->OnError(read_error_);
if (read_success_ && read_error_ != PREF_READ_ERROR_NONE &&
error_delegate_.has_value() && error_delegate_.value()) {
error_delegate_.value()->OnError(read_error_);
}
for (Observer& observer : observers_) {
observer.OnInitializationCompleted(read_success_);

View File

@@ -7,6 +7,7 @@
#include <stdint.h>
#include <optional>
#include <string>
#include "base/observer_list.h"
@@ -51,6 +52,7 @@ class CefPrefStore : public PersistentPrefStore {
base::OnceClosure synchronous_done_callback) override;
void SchedulePendingLossyWrites() override;
void OnStoreDeletionFromDisk() override;
bool HasReadErrorDelegate() const override;
// Marks the store as having completed initialization.
void SetInitializationCompleted();
@@ -111,7 +113,8 @@ class CefPrefStore : public PersistentPrefStore {
// mutation.
bool committed_ = true;
std::unique_ptr<ReadErrorDelegate> error_delegate_;
// Optional so we can differentiate `nullopt` from `nullptr`.
std::optional<std::unique_ptr<ReadErrorDelegate>> error_delegate_;
base::ObserverList<PrefStore::Observer, true>::Unchecked observers_;
};

View File

@@ -29,7 +29,6 @@
#include "services/network/public/cpp/resolve_host_client_base.h"
#include "services/network/public/mojom/clear_data_filter.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "ui/base/ui_base_features.h"
using content::BrowserThread;
@@ -1029,12 +1028,8 @@ void CefRequestContextImpl::SetChromeColorSchemeInternal(
if (current_color) {
// User color is not currently transparent.
// Based on ThemeColorPickerHandler::SetDefaultColor.
if (features::IsChromeWebuiRefresh2023()) {
theme_service->SetUserColor(SK_ColorTRANSPARENT);
theme_service->UseDeviceTheme(false);
} else {
theme_service->UseDefaultTheme();
}
theme_service->SetUserColor(SK_ColorTRANSPARENT);
theme_service->UseDeviceTheme(false);
}
} else {
ui::mojom::BrowserColorVariant ui_variant;
@@ -1060,13 +1055,8 @@ void CefRequestContextImpl::SetChromeColorSchemeInternal(
ui_variant != theme_service->GetBrowserColorVariant()) {
// User color and/or variant has changed.
// Based on ThemeColorPickerHandler::SetSeedColor.
if (features::IsChromeWebuiRefresh2023()) {
theme_service->SetUserColorAndBrowserColorVariant(user_color,
ui_variant);
theme_service->UseDeviceTheme(false);
} else {
theme_service->BuildAutogeneratedThemeFromColor(user_color);
}
theme_service->SetUserColorAndBrowserColorVariant(user_color, ui_variant);
theme_service->UseDeviceTheme(false);
}
}
}

View File

@@ -49,11 +49,11 @@ void CefSpeechRecognitionManagerDelegate::OnAudioEnd(int session_id) {}
void CefSpeechRecognitionManagerDelegate::OnRecognitionResults(
int session_id,
const std::vector<blink::mojom::SpeechRecognitionResultPtr>& result) {}
const std::vector<media::mojom::WebSpeechRecognitionResultPtr>& result) {}
void CefSpeechRecognitionManagerDelegate::OnRecognitionError(
int session_id,
const blink::mojom::SpeechRecognitionError& error) {}
const media::mojom::SpeechRecognitionError& error) {}
void CefSpeechRecognitionManagerDelegate::OnAudioLevelsChange(
int session_id,

View File

@@ -35,11 +35,11 @@ class CefSpeechRecognitionManagerDelegate
void OnRecognitionEnd(int session_id) override;
void OnRecognitionResults(
int session_id,
const std::vector<blink::mojom::SpeechRecognitionResultPtr>& result)
const std::vector<media::mojom::WebSpeechRecognitionResultPtr>& result)
override;
void OnRecognitionError(
int session_id,
const blink::mojom::SpeechRecognitionError& error) override;
const media::mojom::SpeechRecognitionError& error) override;
void OnAudioLevelsChange(int session_id,
float volume,
float noise_volume) override;

View File

@@ -3,6 +3,7 @@
// can be found in the LICENSE file.
#include "base/feature_list.h"
#include "base/features.h"
#include "base/files/file_path.h"
#include "base/path_service.h"
#include "cef/include/test/cef_test_helpers.h"
@@ -17,6 +18,7 @@ void CefSetDataDirectoryForTests(const CefString& dir) {
bool CefIsFeatureEnabledForTests(const CefString& feature_name) {
// Only includes values that are queried by unit tests.
const base::Feature* features[] = {
&base::features::kUseRustJsonParser,
&network::features::kReduceAcceptLanguage,
};

View File

@@ -176,13 +176,13 @@ void CefBrowserPlatformDelegateViews::ViewText(const std::string& text) {
}
bool CefBrowserPlatformDelegateViews::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
// The BrowserView will handle accelerators.
return browser_view_->HandleKeyboardEvent(event);
}
CefEventHandle CefBrowserPlatformDelegateViews::GetEventHandle(
const content::NativeWebKeyboardEvent& event) const {
const input::NativeWebKeyboardEvent& event) const {
return native_delegate_->GetEventHandle(event);
}

View File

@@ -50,10 +50,9 @@ class CefBrowserPlatformDelegateViews
gfx::Point GetScreenPoint(const gfx::Point& view,
bool want_dip_coords) const override;
void ViewText(const std::string& text) override;
bool HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) override;
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event) override;
CefEventHandle GetEventHandle(
const content::NativeWebKeyboardEvent& event) const override;
const input::NativeWebKeyboardEvent& event) const override;
std::unique_ptr<CefMenuRunner> CreateMenuRunner() override;
bool IsViewsHosted() const override;
gfx::Point GetDialogPosition(const gfx::Size& size) override;

View File

@@ -17,7 +17,7 @@
#include "cef/libcef/browser/views/window_impl.h"
#include "cef/libcef/features/runtime.h"
#include "chrome/browser/profiles/profile.h"
#include "content/public/common/input/native_web_keyboard_event.h"
#include "components/input/native_web_keyboard_event.h"
#include "ui/content_accelerators/accelerator_util.h"
namespace {
@@ -186,7 +186,7 @@ void CefBrowserViewImpl::BrowserDestroyed(CefBrowserHostBase* browser) {
}
bool CefBrowserViewImpl::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
const input::NativeWebKeyboardEvent& event) {
if (!root_view()) {
return false;
}
@@ -428,7 +428,7 @@ CefWindowImpl* CefBrowserViewImpl::cef_window_impl() const {
}
bool CefBrowserViewImpl::HandleAccelerator(
const content::NativeWebKeyboardEvent& event,
const input::NativeWebKeyboardEvent& event,
views::FocusManager* focus_manager) {
// Previous calls to TranslateMessage can generate Char events as well as
// RawKeyDown events, even if the latter triggered an accelerator. In these

View File

@@ -60,7 +60,7 @@ class CefBrowserViewImpl
// Called to handle accelerators when the event is unhandled by the web
// content and the browser client.
bool HandleKeyboardEvent(const content::NativeWebKeyboardEvent& event);
bool HandleKeyboardEvent(const input::NativeWebKeyboardEvent& event);
// CefBrowserView methods:
CefRefPtr<CefBrowser> GetBrowser() override;
@@ -120,7 +120,7 @@ class CefBrowserViewImpl
// Logic extracted from UnhandledKeyboardEventHandler::HandleKeyboardEvent for
// the handling of accelerators. Returns true if the event was handled by the
// accelerator.
bool HandleAccelerator(const content::NativeWebKeyboardEvent& event,
bool HandleAccelerator(const input::NativeWebKeyboardEvent& event,
views::FocusManager* focus_manager);
void RequestFocusInternal();

View File

@@ -410,7 +410,8 @@ void CefWindowView::CreateWidget(gfx::AcceleratedWidget parent_widget) {
CefWidget* cef_widget = CefWidget::Create(this);
views::Widget* widget = cef_widget->GetWidget();
views::Widget::InitParams params;
views::Widget::InitParams params(
views::Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET);
params.delegate = this;
views::Widget* host_widget = nullptr;

View File

@@ -60,7 +60,9 @@ bool CefCreateTempDirectoryInDirectory(const CefString& base_dir,
return false;
}
base::FilePath result;
if (base::CreateTemporaryDirInDir(base_dir, prefix, &result)) {
base::FilePath::StringType prefix_str = prefix;
if (base::CreateTemporaryDirInDir(
base_dir, base::FilePath::StringPieceType(prefix_str), &result)) {
new_dir = result.value();
return true;
}

View File

@@ -371,9 +371,9 @@ void CefFrameImpl::OnDraggableRegionsChanged() {
regions.reserve(webregions.size());
for (const auto& webregion : webregions) {
auto region = cef::mojom::DraggableRegionEntry::New(webregion.bounds,
webregion.draggable);
render_frame->ConvertViewportToWindow(&region->bounds);
auto region = cef::mojom::DraggableRegionEntry::New(
render_frame->ConvertViewportToWindow(webregion.bounds),
webregion.draggable);
regions.emplace_back(std::move(region));
}
}