Skip to content

Commit

Permalink
Deprecating OnScreenKeyboard from Starboard (#2785)
Browse files Browse the repository at this point in the history
Deprecate OnScreenKeyboard from Starboard 16. A few events still remain
in the headers and can be cleaned up after the extension gets revised.

Test-On-Device: True

b/151173891
  • Loading branch information
kaidokert committed Apr 1, 2024
1 parent 96283a0 commit eb382f6
Show file tree
Hide file tree
Showing 40 changed files with 97 additions and 510 deletions.
38 changes: 0 additions & 38 deletions cobalt/base/on_screen_keyboard_suggestions_updated_event.h

This file was deleted.

6 changes: 5 additions & 1 deletion cobalt/base/wrap_main_starboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,16 @@ void BaseEventHandler(const SbEvent* event) {
case kSbEventTypeOnScreenKeyboardHidden:
case kSbEventTypeOnScreenKeyboardFocused:
case kSbEventTypeOnScreenKeyboardBlurred:
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
case kSbEventTypeAccessibilityCaptionSettingsChanged:
case kSbEventTypeAccessibilityTextToSpeechSettingsChanged:
case kSbEventTypeOsNetworkDisconnected:
case kSbEventTypeOsNetworkConnected:
case kSbEventDateTimeConfigurationChanged:
#if SB_API_VERSION >= 16
case kSbEventTypeReserved1:
#else
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
#endif // SB_API_VERSION >= 16
event_function(event);
break;
}
Expand Down
5 changes: 1 addition & 4 deletions cobalt/bindings/shared/idl_conditional_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@

#include "starboard/configuration.h"

// Define preprocessor macros that cannot be determined at GYP time for use in
// Define preprocessor macros that cannot be determined at GN time for use in
// IDL files with Conditionals (e.g. conditional interface definitions, or
// conditional attributes). This is necessary to make macros for IDL
// Conditionals that are dependent on Starboard feature macros that get defined
// in header files.

// This is used to conditionally define the On Screen Keyboard interface and
// attribute.
#define COBALT_ENABLE_ON_SCREEN_KEYBOARD

#endif // COBALT_BINDINGS_SHARED_IDL_CONDITIONAL_MACROS_H_
2 changes: 0 additions & 2 deletions cobalt/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ static_library("browser") {
"device_authentication.h",
"on_screen_keyboard_extension_bridge.cc",
"on_screen_keyboard_extension_bridge.h",
"on_screen_keyboard_starboard_bridge.cc",
"on_screen_keyboard_starboard_bridge.h",
"render_tree_combiner.cc",
"render_tree_combiner.h",
"screen_shot_writer.cc",
Expand Down
34 changes: 10 additions & 24 deletions cobalt/browser/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
#include "cobalt/base/on_screen_keyboard_focused_event.h"
#include "cobalt/base/on_screen_keyboard_hidden_event.h"
#include "cobalt/base/on_screen_keyboard_shown_event.h"
#include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h"
#include "cobalt/base/starboard_stats_tracker.h"
#include "cobalt/base/startup_timer.h"
#include "cobalt/base/version_compatibility.h"
Expand Down Expand Up @@ -961,12 +960,6 @@ Application::Application(const base::Closure& quit_closure, bool should_preload,
event_dispatcher_.AddEventCallback(
base::OnScreenKeyboardBlurredEvent::TypeId(),
on_screen_keyboard_blurred_event_callback_);
on_screen_keyboard_suggestions_updated_event_callback_ =
base::Bind(&Application::OnOnScreenKeyboardSuggestionsUpdatedEvent,
base::Unretained(this));
event_dispatcher_.AddEventCallback(
base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(),
on_screen_keyboard_suggestions_updated_event_callback_);
on_caption_settings_changed_event_callback_ = base::Bind(
&Application::OnCaptionSettingsChangedEvent, base::Unretained(this));
event_dispatcher_.AddEventCallback(
Expand Down Expand Up @@ -1070,9 +1063,6 @@ Application::~Application() {
event_dispatcher_.RemoveEventCallback(
base::OnScreenKeyboardBlurredEvent::TypeId(),
on_screen_keyboard_blurred_event_callback_);
event_dispatcher_.RemoveEventCallback(
base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(),
on_screen_keyboard_suggestions_updated_event_callback_);
event_dispatcher_.RemoveEventCallback(
base::AccessibilityCaptionSettingsChangedEvent::TypeId(),
on_caption_settings_changed_event_callback_);
Expand Down Expand Up @@ -1155,10 +1145,6 @@ void Application::HandleStarboardEvent(const SbEvent* starboard_event) {
DispatchEventInternal(new base::OnScreenKeyboardBlurredEvent(
*static_cast<int*>(starboard_event->data)));
break;
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
DispatchEventInternal(new base::OnScreenKeyboardSuggestionsUpdatedEvent(
*static_cast<int*>(starboard_event->data)));
break;
case kSbEventTypeLink: {
DispatchDeepLink(static_cast<const char*>(starboard_event->data),
starboard_event->timestamp);
Expand Down Expand Up @@ -1193,6 +1179,11 @@ void Application::HandleStarboardEvent(const SbEvent* starboard_event) {
case kSbEventTypeStop:
case kSbEventTypeUser:
case kSbEventTypeVerticalSync:
#if SB_API_VERSION >= 16
case kSbEventTypeReserved1:
#else
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
#endif // SB_API_VERSION >= 16
DLOG(WARNING) << "Unhandled Starboard event of type: "
<< starboard_event->type;
}
Expand Down Expand Up @@ -1270,7 +1261,6 @@ void Application::OnApplicationEvent(SbEventType event_type,
case kSbEventTypeOnScreenKeyboardFocused:
case kSbEventTypeOnScreenKeyboardHidden:
case kSbEventTypeOnScreenKeyboardShown:
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
case kSbEventTypeAccessibilitySettingsChanged:
case kSbEventTypeInput:
case kSbEventTypeLink:
Expand All @@ -1280,6 +1270,11 @@ void Application::OnApplicationEvent(SbEventType event_type,
case kSbEventTypeOsNetworkDisconnected:
case kSbEventTypeOsNetworkConnected:
case kSbEventDateTimeConfigurationChanged:
#if SB_API_VERSION >= 16
case kSbEventTypeReserved1:
#else
case kSbEventTypeOnScreenKeyboardSuggestionsUpdated:
#endif // SB_API_VERSION >= 16
NOTREACHED() << "Unexpected event type: " << event_type;
return;
}
Expand Down Expand Up @@ -1337,15 +1332,6 @@ void Application::OnOnScreenKeyboardBlurredEvent(const base::Event* event) {
event));
}

void Application::OnOnScreenKeyboardSuggestionsUpdatedEvent(
const base::Event* event) {
TRACE_EVENT0("cobalt::browser",
"Application::OnOnScreenKeyboardSuggestionsUpdatedEvent()");
browser_module_->OnOnScreenKeyboardSuggestionsUpdated(
base::polymorphic_downcast<
const base::OnScreenKeyboardSuggestionsUpdatedEvent*>(event));
}

void Application::OnCaptionSettingsChangedEvent(const base::Event* event) {
TRACE_EVENT0("cobalt::browser",
"Application::OnCaptionSettingsChangedEvent()");
Expand Down
2 changes: 0 additions & 2 deletions cobalt/browser/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ class Application {
void OnOnScreenKeyboardHiddenEvent(const base::Event* event);
void OnOnScreenKeyboardFocusedEvent(const base::Event* event);
void OnOnScreenKeyboardBlurredEvent(const base::Event* event);
void OnOnScreenKeyboardSuggestionsUpdatedEvent(const base::Event* event);
void OnCaptionSettingsChangedEvent(const base::Event* event);
void OnWindowOnOnlineEvent(const base::Event* event);
void OnWindowOnOfflineEvent(const base::Event* event);
Expand Down Expand Up @@ -111,7 +110,6 @@ class Application {
base::EventCallback on_screen_keyboard_hidden_event_callback_;
base::EventCallback on_screen_keyboard_focused_event_callback_;
base::EventCallback on_screen_keyboard_blurred_event_callback_;
base::EventCallback on_screen_keyboard_suggestions_updated_event_callback_;
base::EventCallback on_caption_settings_changed_event_callback_;
base::EventCallback on_window_on_online_event_callback_;
base::EventCallback on_window_on_offline_event_callback_;
Expand Down
18 changes: 0 additions & 18 deletions cobalt/browser/browser_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include "cobalt/base/source_location.h"
#include "cobalt/base/tokens.h"
#include "cobalt/browser/on_screen_keyboard_extension_bridge.h"
#include "cobalt/browser/on_screen_keyboard_starboard_bridge.h"
#include "cobalt/browser/screen_shot_writer.h"
#include "cobalt/browser/switches.h"
#include "cobalt/browser/user_agent_platform_info.h"
Expand Down Expand Up @@ -315,14 +314,6 @@ BrowserModule::BrowserModule(const GURL& url,
std::make_unique<OnScreenKeyboardExtensionBridge>(
base::Bind(&BrowserModule::GetSbWindow, base::Unretained(this)),
on_screen_keyboard_extension);
} else {
if (OnScreenKeyboardStarboardBridge::IsSupported()) {
on_screen_keyboard_bridge_ =
std::make_unique<OnScreenKeyboardStarboardBridge>(base::Bind(
&BrowserModule::GetSbWindow, base::Unretained(this)));
} else {
on_screen_keyboard_bridge_ = NULL;
}
}
} else {
on_screen_keyboard_bridge_ = NULL;
Expand Down Expand Up @@ -1114,15 +1105,6 @@ void BrowserModule::OnOnScreenKeyboardBlurred(
}
}

void BrowserModule::OnOnScreenKeyboardSuggestionsUpdated(
const base::OnScreenKeyboardSuggestionsUpdatedEvent* event) {
DCHECK_EQ(base::MessageLoop::current(), self_message_loop_);
// Only inject updated suggestions events to the main WebModule.
if (web_module_) {
web_module_->InjectOnScreenKeyboardSuggestionsUpdatedEvent(event->ticket());
}
}

void BrowserModule::OnCaptionSettingsChanged(
const base::AccessibilityCaptionSettingsChangedEvent* event) {
DCHECK_EQ(base::MessageLoop::current(), self_message_loop_);
Expand Down
3 changes: 0 additions & 3 deletions cobalt/browser/browser_module.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include "cobalt/base/on_screen_keyboard_focused_event.h"
#include "cobalt/base/on_screen_keyboard_hidden_event.h"
#include "cobalt/base/on_screen_keyboard_shown_event.h"
#include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h"
#include "cobalt/browser/lifecycle_observer.h"
#include "cobalt/browser/memory_settings/auto_mem.h"
#include "cobalt/browser/memory_settings/checker.h"
Expand Down Expand Up @@ -222,8 +221,6 @@ class BrowserModule {
const base::OnScreenKeyboardFocusedEvent* event);
void OnOnScreenKeyboardBlurred(
const base::OnScreenKeyboardBlurredEvent* event);
void OnOnScreenKeyboardSuggestionsUpdated(
const base::OnScreenKeyboardSuggestionsUpdatedEvent* event);
void OnCaptionSettingsChanged(
const base::AccessibilityCaptionSettingsChangedEvent* event);

Expand Down
128 changes: 0 additions & 128 deletions cobalt/browser/on_screen_keyboard_starboard_bridge.cc

This file was deleted.

Loading

0 comments on commit eb382f6

Please sign in to comment.