Rename browser_util to browser_event_util (seee #3685)

Use more specific file naming. This change is a functional no-op.
This commit is contained in:
Marshall Greenblatt 2024-07-02 14:16:55 -04:00
parent bd57a40256
commit cd3f617171
7 changed files with 15 additions and 23 deletions

View File

@ -477,6 +477,8 @@ source_set("libcef_static") {
"libcef/browser/browser_contents_delegate.h",
"libcef/browser/browser_context.cc",
"libcef/browser/browser_context.h",
"libcef/browser/browser_event_util.cc",
"libcef/browser/browser_event_util.h",
"libcef/browser/browser_frame.cc",
"libcef/browser/browser_frame.h",
"libcef/browser/browser_guest_util.cc",
@ -495,8 +497,6 @@ source_set("libcef_static") {
"libcef/browser/browser_platform_delegate.cc",
"libcef/browser/browser_platform_delegate.h",
"libcef/browser/browser_platform_delegate_create.cc",
"libcef/browser/browser_util.cc",
"libcef/browser/browser_util.h",
"libcef/browser/certificate_query.cc",
"libcef/browser/certificate_query.h",
"libcef/browser/chrome/browser_delegate.h",

View File

@ -5,9 +5,9 @@
#include "cef/libcef/browser/browser_contents_delegate.h"
#include "base/memory/raw_ptr.h"
#include "cef/libcef/browser/browser_event_util.h"
#include "cef/libcef/browser/browser_host_base.h"
#include "cef/libcef/browser/browser_platform_delegate.h"
#include "cef/libcef/browser/browser_util.h"
#include "cef/libcef/browser/native/cursor_util.h"
#include "cef/libcef/common/frame_util.h"
#include "chrome/browser/ui/views/sad_tab_view.h"
@ -252,7 +252,7 @@ CefBrowserContentsDelegate::PreHandleKeyboardEvent(
if (auto c = client()) {
if (auto handler = c->GetKeyboardHandler()) {
CefKeyEvent cef_event;
if (browser_util::GetCefKeyEvent(event, cef_event)) {
if (GetCefKeyEvent(event, cef_event)) {
cef_event.focus_on_editable_field = focus_on_editable_field_;
auto event_handle = delegate->GetEventHandle(event);
@ -284,7 +284,7 @@ bool CefBrowserContentsDelegate::HandleKeyboardEvent(
if (auto c = client()) {
if (auto handler = c->GetKeyboardHandler()) {
CefKeyEvent cef_event;
if (browser_util::GetCefKeyEvent(event, cef_event)) {
if (GetCefKeyEvent(event, cef_event)) {
cef_event.focus_on_editable_field = focus_on_editable_field_;
auto event_handle = delegate->GetEventHandle(event);

View File

@ -2,12 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#include "cef/libcef/browser/browser_util.h"
#include "cef/libcef/browser/browser_event_util.h"
#include "components/input/native_web_keyboard_event.h"
namespace browser_util {
bool GetCefKeyEvent(const input::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event) {
switch (event.GetType()) {
@ -69,5 +67,3 @@ bool GetCefKeyEvent(const ui::KeyEvent& event, CefKeyEvent& cef_event) {
input::NativeWebKeyboardEvent native_event(event);
return GetCefKeyEvent(native_event, cef_event);
}
} // namespace browser_util

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file.
#ifndef CEF_LIBCEF_BROWSER_BROWSER_UTIL_H_
#define CEF_LIBCEF_BROWSER_BROWSER_UTIL_H_
#ifndef CEF_LIBCEF_BROWSER_BROWSER_EVENT_UTIL_H_
#define CEF_LIBCEF_BROWSER_BROWSER_EVENT_UTIL_H_
#pragma once
#include "cef/include/internal/cef_types_wrappers.h"
@ -16,8 +16,6 @@ namespace ui {
class KeyEvent;
}
namespace browser_util {
// Convert a input::NativeWebKeyboardEvent to a CefKeyEvent.
bool GetCefKeyEvent(const input::NativeWebKeyboardEvent& event,
CefKeyEvent& cef_event);
@ -25,6 +23,4 @@ bool GetCefKeyEvent(const input::NativeWebKeyboardEvent& event,
// Convert a ui::KeyEvent to a CefKeyEvent.
bool GetCefKeyEvent(const ui::KeyEvent& event, CefKeyEvent& cef_event);
} // namespace browser_util
#endif // CEF_LIBCEF_BROWSER_BROWSER_UTIL_H_
#endif // CEF_LIBCEF_BROWSER_BROWSER_EVENT_UTIL_H_

View File

@ -7,8 +7,8 @@
#include <memory>
#include <optional>
#include "cef/libcef/browser/browser_event_util.h"
#include "cef/libcef/browser/browser_host_base.h"
#include "cef/libcef/browser/browser_util.h"
#include "cef/libcef/browser/chrome/views/chrome_browser_view.h"
#include "cef/libcef/browser/context.h"
#include "cef/libcef/browser/request_context_impl.h"
@ -184,7 +184,7 @@ bool CefBrowserViewImpl::HandleKeyboardEvent(
// Give the CefWindowDelegate a chance to handle the event.
if (auto* window_impl = cef_window_impl()) {
CefKeyEvent cef_event;
if (browser_util::GetCefKeyEvent(event, cef_event) &&
if (GetCefKeyEvent(event, cef_event) &&
window_impl->OnKeyEvent(cef_event)) {
return true;
}

View File

@ -4,7 +4,7 @@
#include "cef/libcef/browser/views/textfield_view.h"
#include "cef/libcef/browser/browser_util.h"
#include "cef/libcef/browser/browser_event_util.h"
CefTextfieldView::CefTextfieldView(CefTextfieldDelegate* cef_delegate)
: ParentClass(cef_delegate) {
@ -27,7 +27,7 @@ bool CefTextfieldView::HandleKeyEvent(views::Textfield* sender,
}
CefKeyEvent cef_key_event;
if (!browser_util::GetCefKeyEvent(key_event, cef_key_event)) {
if (!GetCefKeyEvent(key_event, cef_key_event)) {
return false;
}

View File

@ -8,7 +8,7 @@
#include "base/i18n/rtl.h"
#include "base/memory/raw_ptr.h"
#include "cef/libcef/browser/browser_util.h"
#include "cef/libcef/browser/browser_event_util.h"
#include "cef/libcef/browser/thread_util.h"
#include "cef/libcef/browser/views/browser_view_impl.h"
#include "cef/libcef/browser/views/display_impl.h"
@ -86,7 +86,7 @@ class CefUnhandledKeyEventHandler : public ui::EventHandler {
}
CefKeyEvent cef_event;
if (browser_util::GetCefKeyEvent(*event, cef_event) &&
if (GetCefKeyEvent(*event, cef_event) &&
window_impl_->OnKeyEvent(cef_event)) {
event->StopPropagation();
}