Update to Chromium version 119.0.6045.0 (#1204232)

Mac: 13.5+ build system w/ 14.0 base SDK (Xcode 15.0) is now required.
This commit is contained in:
Marshall Greenblatt
2023-10-19 14:08:48 -04:00
parent 3476199bc5
commit b2274f534d
96 changed files with 812 additions and 581 deletions

View File

@@ -1500,9 +1500,11 @@ void AlloyBrowserHostImpl::StartDragging(
}
}
void AlloyBrowserHostImpl::UpdateDragCursor(
ui::mojom::DragOperation operation) {
void AlloyBrowserHostImpl::UpdateDragOperation(
ui::mojom::DragOperation operation,
bool document_is_handling_drag) {
if (platform_delegate_) {
platform_delegate_->UpdateDragCursor(operation);
platform_delegate_->UpdateDragOperation(operation,
document_is_handling_drag);
}
}

View File

@@ -163,7 +163,8 @@ class AlloyBrowserHostImpl : public CefBrowserHostBase,
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh);
void UpdateDragCursor(ui::mojom::DragOperation operation);
void UpdateDragOperation(ui::mojom::DragOperation operation,
bool document_is_handling_drag);
// Accessors that must be called on the UI thread.
extensions::ExtensionHost* GetExtensionHost() const;

View File

@@ -85,7 +85,7 @@
#include "base/path_service.h"
#include "chrome/browser/themes/theme_service_aura_linux.h"
#include "chrome/browser/ui/views/theme_profile_key.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/branded_strings.h"
#include "components/os_crypt/sync/key_storage_config_linux.h"
#include "libcef/browser/printing/print_dialog_linux.h"
#include "ui/base/cursor/cursor_factory.h"

View File

@@ -1304,6 +1304,31 @@ AlloyContentBrowserClient::GetSandboxedStorageServiceDataDirectory() {
return GetUserDataPath();
}
base::FilePath AlloyContentBrowserClient::GetShaderDiskCacheDirectory() {
return GetUserDataPath().Append(FILE_PATH_LITERAL("ShaderCache"));
}
base::FilePath AlloyContentBrowserClient::GetGrShaderDiskCacheDirectory() {
return GetUserDataPath().Append(FILE_PATH_LITERAL("GrShaderCache"));
}
base::FilePath AlloyContentBrowserClient::GetGraphiteDawnDiskCacheDirectory() {
return GetUserDataPath().Append(FILE_PATH_LITERAL("GraphiteDawnCache"));
}
base::FilePath AlloyContentBrowserClient::GetNetLogDefaultDirectory() {
return GetUserDataPath();
}
base::FilePath AlloyContentBrowserClient::GetFirstPartySetsDirectory() {
return GetUserDataPath();
}
absl::optional<base::FilePath>
AlloyContentBrowserClient::GetLocalTracesDirectory() {
return GetUserDataPath();
}
std::string AlloyContentBrowserClient::GetProduct() {
return GetChromeProduct();
}

View File

@@ -239,6 +239,12 @@ class AlloyContentBrowserClient : public content::ContentBrowserClient {
mojo::BinderMapWithContext<const content::ServiceWorkerVersionBaseInfo&>*
map) override;
base::FilePath GetSandboxedStorageServiceDataDirectory() override;
base::FilePath GetShaderDiskCacheDirectory() override;
base::FilePath GetGrShaderDiskCacheDirectory() override;
base::FilePath GetGraphiteDawnDiskCacheDirectory() override;
base::FilePath GetNetLogDefaultDirectory() override;
base::FilePath GetFirstPartySetsDirectory() override;
absl::optional<base::FilePath> GetLocalTracesDirectory() override;
std::string GetProduct() override;
std::string GetChromeProduct() override;
std::string GetUserAgent() override;

View File

@@ -360,8 +360,9 @@ void CefBrowserPlatformDelegate::StartDragging(
DCHECK(false);
}
void CefBrowserPlatformDelegate::UpdateDragCursor(
ui::mojom::DragOperation operation) {
void CefBrowserPlatformDelegate::UpdateDragOperation(
ui::mojom::DragOperation operation,
bool document_is_handling_drag) {
DCHECK(false);
}

View File

@@ -350,7 +350,8 @@ class CefBrowserPlatformDelegate {
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh);
virtual void UpdateDragCursor(ui::mojom::DragOperation operation);
virtual void UpdateDragOperation(ui::mojom::DragOperation operation,
bool document_is_handling_drag);
virtual void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op);
virtual void DragSourceSystemDragEnded();
virtual void AccessibilityEventReceived(

View File

@@ -189,10 +189,10 @@ void CefMediaRouterManager::CreateRoute(
const url::Origin& origin,
CreateRouteResultCallback callback) {
GetMediaRouter()->CreateRoute(
source_id, sink_id, origin, nullptr /* web_contents */,
source_id, sink_id, origin, /*web_contents=*/nullptr,
base::BindOnce(&CefMediaRouterManager::OnCreateRoute,
weak_ptr_factory_.GetWeakPtr(), std::move(callback)),
base::Milliseconds(kTimeoutMs), false /* incognito */);
base::Milliseconds(kTimeoutMs));
}
void CefMediaRouterManager::SendRouteMessage(

View File

@@ -347,6 +347,7 @@ void CefBrowserPlatformDelegateOsr::DragTargetDragEnter(
CefDragDataImpl* data_impl = static_cast<CefDragDataImpl*>(drag_data.get());
base::AutoLock lock_scope(data_impl->lock());
content::DropData* drop_data = data_impl->drop_data();
drop_data->document_is_handling_drag = document_is_handling_drag_;
const gfx::Point& screen_pt =
GetScreenPoint(client_pt, /*want_dip_coords=*/false);
blink::DragOperationsMask ops =
@@ -494,6 +495,7 @@ void CefBrowserPlatformDelegateOsr::DragTargetDrop(const CefMouseEvent& event) {
static_cast<CefDragDataImpl*>(drag_data_.get());
base::AutoLock lock_scope(data_impl->lock());
content::DropData* drop_data = data_impl->drop_data();
drop_data->document_is_handling_drag = document_is_handling_drag_;
int modifiers = TranslateWebEventModifiers(event.modifiers);
target_rwh->DragTargetDrop(*drop_data, transformed_pt,
@@ -535,8 +537,11 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
}
}
void CefBrowserPlatformDelegateOsr::UpdateDragCursor(
ui::mojom::DragOperation operation) {
void CefBrowserPlatformDelegateOsr::UpdateDragOperation(
ui::mojom::DragOperation operation,
bool document_is_handling_drag) {
document_is_handling_drag_ = document_is_handling_drag;
CefRefPtr<CefRenderHandler> handler =
browser_->GetClient()->GetRenderHandler();
if (handler.get()) {

View File

@@ -82,7 +82,8 @@ class CefBrowserPlatformDelegateOsr
const gfx::Vector2d& image_offset,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh) override;
void UpdateDragCursor(ui::mojom::DragOperation operation) override;
void UpdateDragOperation(ui::mojom::DragOperation operation,
bool document_is_handling_drag) override;
void DragSourceEndedAt(int x, int y, cef_drag_operations_mask_t op) override;
void DragSourceSystemDragEnded() override;
void AccessibilityEventReceived(
@@ -125,11 +126,16 @@ class CefBrowserPlatformDelegateOsr
// We also keep track of the RenderViewHost we're dragging over to avoid
// sending the drag exited message after leaving the current
// view. |current_rvh_for_drag_| should not be dereferenced.
void* current_rvh_for_drag_;
void* current_rvh_for_drag_ = nullptr;
// We keep track of the RenderWidgetHost from which the current drag started,
// in order to properly route the drag end message to it.
base::WeakPtr<content::RenderWidgetHostImpl> drag_start_rwh_;
// Set to true when the document is handling the drag. This means that the
// document has registered an interest in the dropped data and the renderer
// process should pass the data to the document on drop.
bool document_is_handling_drag_ = false;
};
#endif // CEF_LIBCEF_BROWSER_OSR_BROWSER_PLATFORM_DELEGATE_OSR_H_

View File

@@ -108,7 +108,7 @@ struct PopulateAxNodeAttributes {
case ax::mojom::IntAttribute::kInPageLinkTargetId:
case ax::mojom::IntAttribute::kErrormessageIdDeprecated:
case ax::mojom::IntAttribute::kDOMNodeId:
case ax::mojom::IntAttribute::kDropeffect:
case ax::mojom::IntAttribute::kDropeffectDeprecated:
case ax::mojom::IntAttribute::kMemberOfId:
case ax::mojom::IntAttribute::kNextFocusId:
case ax::mojom::IntAttribute::kNextWindowFocusId:

View File

@@ -44,32 +44,10 @@ void CefWebContentsViewOSR::RenderViewCreated() {
}
}
gfx::NativeView CefWebContentsViewOSR::GetNativeView() const {
return gfx::NativeView();
}
gfx::NativeView CefWebContentsViewOSR::GetContentNativeView() const {
return gfx::NativeView();
}
gfx::NativeWindow CefWebContentsViewOSR::GetTopLevelNativeWindow() const {
return gfx::NativeWindow();
}
gfx::Rect CefWebContentsViewOSR::GetContainerBounds() const {
return GetViewBounds();
}
void CefWebContentsViewOSR::Focus() {}
void CefWebContentsViewOSR::SetInitialFocus() {}
void CefWebContentsViewOSR::StoreFocus() {}
void CefWebContentsViewOSR::RestoreFocus() {}
void CefWebContentsViewOSR::FocusThroughTabTraversal(bool reverse) {}
void CefWebContentsViewOSR::GotFocus(
content::RenderWidgetHostImpl* render_widget_host) {
if (web_contents_) {
@@ -98,19 +76,11 @@ void CefWebContentsViewOSR::TakeFocus(bool reverse) {
}
}
void CefWebContentsViewOSR::FullscreenStateChanged(bool is_fullscreen) {}
content::DropData* CefWebContentsViewOSR::GetDropData() const {
return nullptr;
}
gfx::Rect CefWebContentsViewOSR::GetViewBounds() const {
CefRenderWidgetHostViewOSR* view = GetView();
return view ? view->GetViewBounds() : gfx::Rect();
}
void CefWebContentsViewOSR::CreateView(gfx::NativeView context) {}
content::RenderWidgetHostViewBase* CefWebContentsViewOSR::CreateViewForWidget(
content::RenderWidgetHost* render_widget_host) {
if (render_widget_host->GetView()) {
@@ -135,29 +105,6 @@ CefWebContentsViewOSR::CreateViewForChildWidget(
render_widget_host, view);
}
void CefWebContentsViewOSR::SetPageTitle(const std::u16string& title) {}
void CefWebContentsViewOSR::RenderViewReady() {
RenderViewCreated();
}
void CefWebContentsViewOSR::RenderViewHostChanged(
content::RenderViewHost* old_host,
content::RenderViewHost* new_host) {}
void CefWebContentsViewOSR::SetOverscrollControllerEnabled(bool enabled) {}
void CefWebContentsViewOSR::OnCapturerCountChanged() {}
void CefWebContentsViewOSR::UpdateWindowControlsOverlay(
const gfx::Rect& bounding_rect) {}
#if BUILDFLAG(IS_MAC)
bool CefWebContentsViewOSR::CloseTabAfterEventTrackingIfNeeded() {
return false;
}
#endif // BUILDFLAG(IS_MAC)
void CefWebContentsViewOSR::ShowContextMenu(
content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) {
@@ -176,6 +123,7 @@ void CefWebContentsViewOSR::ShowContextMenu(
void CefWebContentsViewOSR::StartDragging(
const content::DropData& drop_data,
const url::Origin& source_origin,
blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
const gfx::Vector2d& cursor_offset,
@@ -192,11 +140,12 @@ void CefWebContentsViewOSR::StartDragging(
}
}
void CefWebContentsViewOSR::UpdateDragCursor(
ui::mojom::DragOperation operation) {
void CefWebContentsViewOSR::UpdateDragOperation(
ui::mojom::DragOperation operation,
bool document_is_handling_drag) {
CefRefPtr<AlloyBrowserHostImpl> browser = GetBrowser();
if (browser.get()) {
browser->UpdateDragCursor(operation);
browser->UpdateDragOperation(operation, document_is_handling_drag);
}
}

View File

@@ -39,51 +39,58 @@ class CefWebContentsViewOSR : public content::WebContentsView,
void RenderViewCreated();
// WebContentsView methods.
gfx::NativeView GetNativeView() const override;
gfx::NativeView GetContentNativeView() const override;
gfx::NativeWindow GetTopLevelNativeWindow() const override;
gfx::NativeView GetNativeView() const override { return gfx::NativeView(); }
gfx::NativeView GetContentNativeView() const override {
return gfx::NativeView();
}
gfx::NativeWindow GetTopLevelNativeWindow() const override {
return gfx::NativeWindow();
}
gfx::Rect GetContainerBounds() const override;
void Focus() override;
void SetInitialFocus() override;
void StoreFocus() override;
void RestoreFocus() override;
void FocusThroughTabTraversal(bool reverse) override;
content::DropData* GetDropData() const override;
void Focus() override {}
void SetInitialFocus() override {}
void StoreFocus() override {}
void RestoreFocus() override {}
void FocusThroughTabTraversal(bool reverse) override {}
content::DropData* GetDropData() const override { return nullptr; }
gfx::Rect GetViewBounds() const override;
void CreateView(gfx::NativeView context) override;
void CreateView(gfx::NativeView context) override {}
content::RenderWidgetHostViewBase* CreateViewForWidget(
content::RenderWidgetHost* render_widget_host) override;
content::RenderWidgetHostViewBase* CreateViewForChildWidget(
content::RenderWidgetHost* render_widget_host) override;
void SetPageTitle(const std::u16string& title) override;
void RenderViewReady() override;
void SetPageTitle(const std::u16string& title) override {}
void RenderViewReady() override {}
void RenderViewHostChanged(content::RenderViewHost* old_host,
content::RenderViewHost* new_host) override;
void SetOverscrollControllerEnabled(bool enabled) override;
void OnCapturerCountChanged() override;
void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) override;
content::RenderViewHost* new_host) override {}
void SetOverscrollControllerEnabled(bool enabled) override {}
void OnCapturerCountChanged() override {}
void UpdateWindowControlsOverlay(const gfx::Rect& bounding_rect) override {}
void CancelDragDropForPortalActivation() override {}
#if BUILDFLAG(IS_MAC)
bool CloseTabAfterEventTrackingIfNeeded() override;
bool CloseTabAfterEventTrackingIfNeeded() override { return false; }
#endif
// RenderViewHostDelegateView methods.
void ShowContextMenu(content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) override;
void StartDragging(const content::DropData& drop_data,
const url::Origin& source_origin,
blink::DragOperationsMask allowed_ops,
const gfx::ImageSkia& image,
const gfx::Vector2d& cursor_offset,
const gfx::Rect& drag_obj_rect,
const blink::mojom::DragEventSourceInfo& event_info,
content::RenderWidgetHostImpl* source_rwh) override;
void UpdateDragCursor(ui::mojom::DragOperation operation) override;
void UpdateDragOperation(ui::mojom::DragOperation operation,
bool document_is_handling_drag) override;
virtual void GotFocus(
content::RenderWidgetHostImpl* render_widget_host) override;
virtual void LostFocus(
content::RenderWidgetHostImpl* render_widget_host) override;
virtual void TakeFocus(bool reverse) override;
virtual void FullscreenStateChanged(bool is_fullscreen) override;
virtual void FullscreenStateChanged(bool is_fullscreen) override {}
private:
CefRenderWidgetHostViewOSR* GetView() const;

View File

@@ -25,8 +25,8 @@
#include "chrome/browser/media/webrtc/permission_bubble_media_access_handler.h"
#include "chrome/browser/net/profile_network_context_service.h"
#include "chrome/browser/net/system_network_context_manager.h"
#include "chrome/browser/prefetch/prefetch_prefs.h"
#include "chrome/browser/prefs/chrome_command_line_pref_store.h"
#include "chrome/browser/preloading/preloading_prefs.h"
#include "chrome/browser/printing/print_preview_sticky_settings.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ssl/ssl_config_service_manager.h"
@@ -55,7 +55,7 @@
#include "components/prefs/pref_filter.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/pref_service.h"
#include "components/privacy_sandbox/privacy_sandbox_prefs.h"
#include "components/privacy_sandbox/tracking_protection_prefs.h"
#include "components/proxy_config/pref_proxy_config_tracker_impl.h"
#include "components/proxy_config/proxy_config_dictionary.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
@@ -269,7 +269,7 @@ std::unique_ptr<PrefService> CreatePrefService(Profile* profile,
permissions::PermissionHatsTriggerHelper::RegisterProfilePrefs(
registry.get());
prefetch::RegisterPredictionOptionsProfilePrefs(registry.get());
privacy_sandbox::RegisterProfilePrefs(registry.get());
privacy_sandbox::tracking_protection::RegisterProfilePrefs(registry.get());
ProfileNetworkContextService::RegisterProfilePrefs(registry.get());
safe_browsing::RegisterProfilePrefs(registry.get());
unified_consent::UnifiedConsentService::RegisterPrefs(registry.get());

View File

@@ -347,9 +347,6 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
RegisterAnimationPolicyPrefs(registry);
// From chrome/browser/ui/browser_ui_prefs.cc RegisterBrowserUserPrefs.
registry->RegisterBooleanPref(
prefs::kEnableDoNotTrack, false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(prefs::kCaretBrowsingEnabled, false);
registry->RegisterStringPref(prefs::kWebRTCIPHandlingPolicy,

View File

@@ -170,9 +170,6 @@ void GetHeaderMap(const CefRequest::HeaderMap& source,
return; \
}
#define SETBOOLFLAG(obj, flags, method, FLAG) \
obj.method((flags & (FLAG)) == (FLAG))
// CefRequest -----------------------------------------------------------------
// static
@@ -611,10 +608,12 @@ void CefRequestImpl::Get(const cef::mojom::RequestParamsPtr& params,
}
request.SetCacheMode(GetFetchCacheMode(flags));
SETBOOLFLAG(request, params->load_flags, SetAllowStoredCredentials,
UR_FLAG_ALLOW_STORED_CREDENTIALS);
SETBOOLFLAG(request, params->load_flags, SetReportUploadProgress,
UR_FLAG_REPORT_UPLOAD_PROGRESS);
request.SetCredentialsMode(
(params->load_flags & UR_FLAG_ALLOW_STORED_CREDENTIALS)
? network::mojom::CredentialsMode::kInclude
: network::mojom::CredentialsMode::kOmit);
request.SetReportUploadProgress(params->load_flags &
UR_FLAG_REPORT_UPLOAD_PROGRESS);
}
void CefRequestImpl::Get(cef::mojom::RequestParamsPtr& params) const {

View File

@@ -30,6 +30,81 @@ using blink::WebInputElement;
using blink::WebNode;
using blink::WebSelectElement;
using blink::WebString;
using FormControlType = WebFormControlElement::Type;
namespace {
cef_dom_form_control_type_t GetCefFormControlType(FormControlType type) {
switch (type) {
case FormControlType::kButtonButton:
return DOM_FORM_CONTROL_TYPE_BUTTON_BUTTON;
case FormControlType::kButtonSubmit:
return DOM_FORM_CONTROL_TYPE_BUTTON_SUBMIT;
case FormControlType::kButtonReset:
return DOM_FORM_CONTROL_TYPE_BUTTON_RESET;
case FormControlType::kButtonSelectList:
return DOM_FORM_CONTROL_TYPE_BUTTON_SELECT_LIST;
case FormControlType::kFieldset:
return DOM_FORM_CONTROL_TYPE_FIELDSET;
case FormControlType::kInputButton:
return DOM_FORM_CONTROL_TYPE_INPUT_BUTTON;
case FormControlType::kInputCheckbox:
return DOM_FORM_CONTROL_TYPE_INPUT_CHECKBOX;
case FormControlType::kInputColor:
return DOM_FORM_CONTROL_TYPE_INPUT_COLOR;
case FormControlType::kInputDate:
return DOM_FORM_CONTROL_TYPE_INPUT_DATE;
case FormControlType::kInputDatetimeLocal:
return DOM_FORM_CONTROL_TYPE_INPUT_DATETIME_LOCAL;
case FormControlType::kInputEmail:
return DOM_FORM_CONTROL_TYPE_INPUT_EMAIL;
case FormControlType::kInputFile:
return DOM_FORM_CONTROL_TYPE_INPUT_FILE;
case FormControlType::kInputHidden:
return DOM_FORM_CONTROL_TYPE_INPUT_HIDDEN;
case FormControlType::kInputImage:
return DOM_FORM_CONTROL_TYPE_INPUT_IMAGE;
case FormControlType::kInputMonth:
return DOM_FORM_CONTROL_TYPE_INPUT_MONTH;
case FormControlType::kInputNumber:
return DOM_FORM_CONTROL_TYPE_INPUT_NUMBER;
case FormControlType::kInputPassword:
return DOM_FORM_CONTROL_TYPE_INPUT_PASSWORD;
case FormControlType::kInputRadio:
return DOM_FORM_CONTROL_TYPE_INPUT_RADIO;
case FormControlType::kInputRange:
return DOM_FORM_CONTROL_TYPE_INPUT_RANGE;
case FormControlType::kInputReset:
return DOM_FORM_CONTROL_TYPE_INPUT_RESET;
case FormControlType::kInputSearch:
return DOM_FORM_CONTROL_TYPE_INPUT_SEARCH;
case FormControlType::kInputSubmit:
return DOM_FORM_CONTROL_TYPE_INPUT_SUBMIT;
case FormControlType::kInputTelephone:
return DOM_FORM_CONTROL_TYPE_INPUT_TELEPHONE;
case FormControlType::kInputText:
return DOM_FORM_CONTROL_TYPE_INPUT_TEXT;
case FormControlType::kInputTime:
return DOM_FORM_CONTROL_TYPE_INPUT_TIME;
case FormControlType::kInputUrl:
return DOM_FORM_CONTROL_TYPE_INPUT_URL;
case FormControlType::kInputWeek:
return DOM_FORM_CONTROL_TYPE_INPUT_WEEK;
case FormControlType::kOutput:
return DOM_FORM_CONTROL_TYPE_OUTPUT;
case FormControlType::kSelectOne:
return DOM_FORM_CONTROL_TYPE_SELECT_ONE;
case FormControlType::kSelectMultiple:
return DOM_FORM_CONTROL_TYPE_SELECT_MULTIPLE;
case FormControlType::kSelectList:
return DOM_FORM_CONTROL_TYPE_SELECT_LIST;
case FormControlType::kTextArea:
return DOM_FORM_CONTROL_TYPE_TEXT_AREA;
}
return DOM_FORM_CONTROL_TYPE_UNSUPPORTED;
}
} // namespace
CefDOMNodeImpl::CefDOMNodeImpl(CefRefPtr<CefDOMDocumentImpl> document,
const blink::WebNode& node)
@@ -113,10 +188,9 @@ bool CefDOMNodeImpl::IsFormControlElement() {
return false;
}
CefString CefDOMNodeImpl::GetFormControlElementType() {
CefString str;
CefDOMNodeImpl::FormControlType CefDOMNodeImpl::GetFormControlElementType() {
if (!VerifyContext()) {
return str;
return DOM_FORM_CONTROL_TYPE_UNSUPPORTED;
}
if (node_.IsElementNode()) {
@@ -125,14 +199,11 @@ CefString CefDOMNodeImpl::GetFormControlElementType() {
// Retrieve the type from the form control element.
const WebFormControlElement& formElement =
node_.To<WebFormControlElement>();
const std::u16string& form_control_type =
formElement.FormControlType().Utf16();
str = form_control_type;
return GetCefFormControlType(formElement.FormControlType());
}
}
return str;
return DOM_FORM_CONTROL_TYPE_UNSUPPORTED;
}
bool CefDOMNodeImpl::IsSame(CefRefPtr<CefDOMNode> that) {
@@ -175,19 +246,7 @@ CefString CefDOMNodeImpl::GetValue() {
const WebFormControlElement& formElement =
node_.To<WebFormControlElement>();
std::u16string value;
const std::u16string& form_control_type =
formElement.FormControlType().Utf16();
if (form_control_type == u"text") {
const WebInputElement& input_element =
formElement.To<WebInputElement>();
value = input_element.Value().Utf16();
} else if (form_control_type == u"select-one") {
const WebSelectElement& select_element =
formElement.To<WebSelectElement>();
value = select_element.Value().Utf16();
}
std::u16string value = formElement.Value().Utf16();
base::TrimWhitespace(value, base::TRIM_LEADING, &value);
str = value;
}

View File

@@ -23,7 +23,7 @@ class CefDOMNodeImpl : public CefDOMNode {
bool IsElement() override;
bool IsEditable() override;
bool IsFormControlElement() override;
CefString GetFormControlElementType() override;
FormControlType GetFormControlElementType() override;
bool IsSame(CefRefPtr<CefDOMNode> that) override;
CefString GetName() override;
CefString GetValue() override;

View File

@@ -9,7 +9,6 @@
#include "libcef/renderer/extensions/extensions_dispatcher_delegate.h"
#include "base/stl_util.h"
#include "base/types/optional_util.h"
#include "chrome/common/url_constants.h"
#include "chrome/renderer/extensions/resource_request_policy.h"
#include "content/public/common/content_constants.h"
@@ -126,8 +125,7 @@ void CefExtensionsRendererClient::WillSendRequest(
// URL to something invalid to prevent the request and cause an error.
if (url.ProtocolIs(extensions::kExtensionScheme) &&
!resource_request_policy_->CanRequestResource(
GURL(url), frame, transition_type,
base::OptionalFromPtr(initiator_origin))) {
GURL(url), frame, transition_type, initiator_origin)) {
*new_url = GURL(chrome::kExtensionInvalidRequestURL);
}
}