Bug 1276406 Remove "ime-enabled-state-changed" notification completely r?smaug
"ime-enabled-state-changed" notification was implemented for Android in
bug 603848 but nobody currently observes this notification. Therefore, we can stop notify the observer service of this.
MozReview-Commit-ID: 3TNHf1xWo2l
--- a/dom/events/IMEStateManager.cpp
+++ b/dom/events/IMEStateManager.cpp
@@ -889,44 +889,16 @@ IMEStateManager::GetNewIMEState(nsPresCo
MOZ_LOG(sISMLog, LogLevel::Debug,
("ISM: IMEStateManager::GetNewIMEState() returns { mEnabled=%s, "
"mOpen=%s }",
GetIMEStateEnabledName(newIMEState.mEnabled),
GetIMEStateSetOpenName(newIMEState.mOpen)));
return newIMEState;
}
-// Helper class, used for IME enabled state change notification
-class IMEEnabledStateChangedEvent : public Runnable {
-public:
- explicit IMEEnabledStateChangedEvent(uint32_t aState)
- : mState(aState)
- {
- }
-
- NS_IMETHOD Run()
- {
- nsCOMPtr<nsIObserverService> observerService =
- services::GetObserverService();
- if (observerService) {
- MOZ_LOG(sISMLog, LogLevel::Info,
- ("ISM: IMEEnabledStateChangedEvent::Run(), notifies observers of "
- "\"ime-enabled-state-changed\""));
- nsAutoString state;
- state.AppendInt(mState);
- observerService->NotifyObservers(nullptr, "ime-enabled-state-changed",
- state.get());
- }
- return NS_OK;
- }
-
-private:
- uint32_t mState;
-};
-
static bool
MayBeIMEUnawareWebApp(nsINode* aNode)
{
bool haveKeyEventsListener = false;
while (aNode) {
EventListenerManager* const mgr = aNode->GetExistingListenerManager();
if (mgr) {
@@ -1108,25 +1080,16 @@ IMEStateManager::SetInputContext(nsIWidg
GetActionCauseName(aAction.mCause),
GetActionFocusChangeName(aAction.mFocusChange),
sActiveTabParent.get()));
MOZ_RELEASE_ASSERT(aWidget);
aWidget->SetInputContext(aInputContext, aAction);
sActiveInputContextWidget = aWidget;
-
- // Don't compare with old IME enabled state for reducing the count of
- // notifying observers since in a remote process, nsIWidget::GetInputContext()
- // call here may cause synchronous IPC, it's much more expensive than
- // notifying observes.
-
- // XXX Looks like nobody is observing this.
- nsContentUtils::AddScriptRunner(
- new IMEEnabledStateChangedEvent(aInputContext.mIMEState.mEnabled));
}
// static
void
IMEStateManager::EnsureTextCompositionArray()
{
if (sTextCompositions) {
return;