Rename SendFocusEvent to SetFocus (fixes issue #866)

Also removes CefBrowserHost::SendFocusEvent. Use the existing SetFocus method
instead.
This commit is contained in:
Marshall Greenblatt
2021-09-27 10:50:07 +03:00
parent 263160aa14
commit 49a4611e28
30 changed files with 43 additions and 95 deletions

View File

@@ -1041,7 +1041,7 @@ void BrowserWindowOsrGtk::Show() {
}
// Give focus to the browser.
browser_->GetHost()->SendFocusEvent(true);
browser_->GetHost()->SetFocus(true);
}
void BrowserWindowOsrGtk::Hide() {
@@ -1051,7 +1051,7 @@ void BrowserWindowOsrGtk::Hide() {
return;
// Remove focus from the browser.
browser_->GetHost()->SendFocusEvent(false);
browser_->GetHost()->SetFocus(false);
if (!hidden_) {
// Set the browser as hidden.
@@ -1648,7 +1648,7 @@ gint BrowserWindowOsrGtk::FocusEvent(GtkWidget* widget,
BrowserWindowOsrGtk* self) {
// May be called on the main thread and the UI thread.
if (self->browser_.get())
self->browser_->GetHost()->SendFocusEvent(event->in == TRUE);
self->browser_->GetHost()->SetFocus(event->in == TRUE);
return TRUE;
}

View File

@@ -486,7 +486,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
- (BOOL)becomeFirstResponder {
CefRefPtr<CefBrowser> browser = [self getBrowser];
if (browser.get()) {
browser->GetHost()->SendFocusEvent(true);
browser->GetHost()->SetFocus(true);
return [super becomeFirstResponder];
}
@@ -496,7 +496,7 @@ NSPoint ConvertPointFromWindowToScreen(NSWindow* window, NSPoint point) {
- (BOOL)resignFirstResponder {
CefRefPtr<CefBrowser> browser = [self getBrowser];
if (browser.get()) {
browser->GetHost()->SendFocusEvent(false);
browser->GetHost()->SetFocus(false);
return [super resignFirstResponder];
}
@@ -1431,7 +1431,7 @@ void BrowserWindowOsrMacImpl::Show() {
}
// Give focus to the browser.
browser_window_.browser_->GetHost()->SendFocusEvent(true);
browser_window_.browser_->GetHost()->SetFocus(true);
}
void BrowserWindowOsrMacImpl::Hide() {
@@ -1441,7 +1441,7 @@ void BrowserWindowOsrMacImpl::Hide() {
return;
// Remove focus from the browser.
browser_window_.browser_->GetHost()->SendFocusEvent(false);
browser_window_.browser_->GetHost()->SetFocus(false);
if (!hidden_) {
// Set the browser as hidden.

View File

@@ -202,7 +202,7 @@ void OsrWindowWin::Show() {
}
// Give focus to the browser.
browser_->GetHost()->SendFocusEvent(true);
browser_->GetHost()->SetFocus(true);
}
void OsrWindowWin::Hide() {
@@ -216,7 +216,7 @@ void OsrWindowWin::Hide() {
return;
// Remove focus from the browser.
browser_->GetHost()->SendFocusEvent(false);
browser_->GetHost()->SetFocus(false);
if (!hidden_) {
// Set the browser as hidden.
@@ -762,7 +762,7 @@ void OsrWindowWin::OnSize() {
void OsrWindowWin::OnFocus(bool setFocus) {
if (browser_)
browser_->GetHost()->SendFocusEvent(setFocus);
browser_->GetHost()->SetFocus(setFocus);
}
void OsrWindowWin::OnCaptureLost() {

View File

@@ -548,7 +548,7 @@ class OSRTestHandler : public RoutingTestHandler,
case OSR_TEST_FOCUS:
if (StartTest()) {
// body.onfocus will make LI00 red
browser->GetHost()->SendFocusEvent(true);
browser->GetHost()->SetFocus(true);
}
break;
case OSR_TEST_TAKE_FOCUS:
@@ -566,7 +566,7 @@ class OSRTestHandler : public RoutingTestHandler,
break;
case OSR_TEST_GOT_FOCUS:
if (StartTest()) {
browser->GetHost()->SendFocusEvent(true);
browser->GetHost()->SetFocus(true);
}
break;
case OSR_TEST_CURSOR:
@@ -750,7 +750,7 @@ class OSRTestHandler : public RoutingTestHandler,
ExpandDropDown();
// Wait for the first popup paint to occur
} else if (type == PET_POPUP) {
browser->GetHost()->SendFocusEvent(false);
browser->GetHost()->SetFocus(false);
}
break;
case OSR_TEST_POPUP_HIDE_ON_ESC:
@@ -1422,7 +1422,7 @@ class OSRTestHandler : public RoutingTestHandler,
}
void ExpandDropDown() {
GetBrowser()->GetHost()->SendFocusEvent(true);
GetBrowser()->GetHost()->SetFocus(true);
CefMouseEvent mouse_event;
const CefRect& LI11select = GetElementBounds("LI11select");