Bug 1431898. Simplify the UpdateCommands setup on windows. r=mystor

MozReview-Commit-ID: 3TqFifdyLTr
This commit is contained in:
Boris Zbarsky 2018-01-22 12:59:15 -05:00
parent bb72d7fd1d
commit da2c3d4bcb
6 changed files with 12 additions and 15 deletions

View file

@ -4289,15 +4289,14 @@ nsGlobalWindowInner::ConvertDialogOptions(const nsAString& aOptions,
}
}
nsresult
void
nsGlobalWindowInner::UpdateCommands(const nsAString& anAction,
nsISelection* aSel,
int16_t aReason)
{
if (GetOuterWindowInternal()) {
return GetOuterWindowInternal()->UpdateCommands(anAction, aSel, aReason);
GetOuterWindowInternal()->UpdateCommands(anAction, aSel, aReason);
}
return NS_OK;
}
Selection*

View file

@ -896,7 +896,7 @@ public:
const nsAString& aOptions,
const mozilla::dom::Sequence<JS::Value>& aExtraArgument,
mozilla::ErrorResult& aError);
nsresult UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) override;
void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason);
void GetContent(JSContext* aCx,
JS::MutableHandle<JSObject*> aRetval,

View file

@ -6364,7 +6364,7 @@ public:
};
} // anonymous namespace
nsresult
void
nsGlobalWindowOuter::UpdateCommands(const nsAString& anAction,
nsISelection* aSel,
int16_t aReason)
@ -6377,13 +6377,14 @@ nsGlobalWindowOuter::UpdateCommands(const nsAString& anAction,
nsContentUtils::AddScriptRunner(
new ChildCommandDispatcher(root, child, anAction));
}
return NS_OK;
return;
}
}
nsPIDOMWindowOuter *rootWindow = GetPrivateRoot();
if (!rootWindow)
return NS_OK;
if (!rootWindow) {
return;
}
nsCOMPtr<nsIDOMXULDocument> xulDoc =
do_QueryInterface(rootWindow->GetExtantDoc());
@ -6399,8 +6400,6 @@ nsGlobalWindowOuter::UpdateCommands(const nsAString& anAction,
anAction));
}
}
return NS_OK;
}
Selection*

View file

@ -686,7 +686,7 @@ public:
const nsAString& aOptions,
nsISupports* aExtraArgument,
nsPIDOMWindowOuter** _retval) override;
nsresult UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) override;
void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) override;
already_AddRefed<nsPIDOMWindowOuter>
GetContentInternal(mozilla::ErrorResult& aError,

View file

@ -613,8 +613,6 @@ public:
virtual nsresult Focus() = 0;
virtual nsresult Close() = 0;
virtual nsresult UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) = 0;
mozilla::dom::DocGroup* GetDocGroup() const;
virtual nsISerialEventTarget*
EventTargetFor(mozilla::TaskCategory aCategory) const = 0;
@ -1138,7 +1136,7 @@ public:
virtual nsresult MoveBy(int32_t aXDif, int32_t aYDif) = 0;
virtual nsresult UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) = 0;
virtual void UpdateCommands(const nsAString& anAction, nsISelection* aSel, int16_t aReason) = 0;
mozilla::dom::DocGroup* GetDocGroup() const;
virtual nsISerialEventTarget*

View file

@ -1127,7 +1127,8 @@ nsTextInputListener::UpdateTextInputCommands(const nsAString& commandsToUpdate,
nsPIDOMWindowOuter *domWindow = doc->GetWindow();
NS_ENSURE_TRUE(domWindow, NS_ERROR_FAILURE);
return domWindow->UpdateCommands(commandsToUpdate, sel, reason);
domWindow->UpdateCommands(commandsToUpdate, sel, reason);
return NS_OK;
}
// END nsTextInputListener