Skip to content

Commit

Permalink
Bug 1296993 (part 6) - Streamline nsIWidget::SetPluginFocused. r=msta…
Browse files Browse the repository at this point in the history
…nge.

This patch removes the return value, because none of the call sites check it.
  • Loading branch information
nnethercote committed Aug 25, 2016
1 parent 31fdb55 commit c2fd85e
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions widget/PuppetWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -667,13 +667,12 @@ PuppetWidget::StartPluginIME(const mozilla::WidgetKeyboardEvent& aKeyboardEvent,
return NS_OK;
}

NS_IMETHODIMP
void
PuppetWidget::SetPluginFocused(bool& aFocused)
{
if (!mTabChild || !mTabChild->SendSetPluginFocused(aFocused)) {
return NS_ERROR_FAILURE;
if (mTabChild) {
mTabChild->SendSetPluginFocused(aFocused);
}
return NS_OK;
}

void
Expand Down
2 changes: 1 addition & 1 deletion widget/PuppetWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class PuppetWidget : public nsBaseWidget
int32_t aPanelX, int32_t aPanelY,
nsString& aCommitted) override;

NS_IMETHOD SetPluginFocused(bool& aFocused) override;
virtual void SetPluginFocused(bool& aFocused) override;
virtual void DefaultProcOfPluginEvent(
const mozilla::WidgetPluginEvent& aEvent) override;

Expand Down
2 changes: 1 addition & 1 deletion widget/cocoa/nsChildView.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ class nsChildView : public nsBaseWidget
int32_t aPanelX, int32_t aPanelY,
nsString& aCommitted) override;

NS_IMETHOD SetPluginFocused(bool& aFocused) override;
virtual void SetPluginFocused(bool& aFocused) override;

bool IsPluginFocused() { return mPluginFocused; }

Expand Down
5 changes: 2 additions & 3 deletions widget/cocoa/nsChildView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1712,11 +1712,11 @@ inline uint16_t COLOR8TOCOLOR16(uint8_t color8)
return NS_OK;
}

NS_IMETHODIMP
void
nsChildView::SetPluginFocused(bool& aFocused)
{
if (aFocused == mPluginFocused) {
return NS_OK;
return;
}
if (!aFocused) {
ComplexTextInputPanel* ctiPanel =
Expand All @@ -1726,7 +1726,6 @@ inline uint16_t COLOR8TOCOLOR16(uint8_t color8)
}
}
mPluginFocused = aFocused;
return NS_OK;
}

NS_IMETHODIMP_(void)
Expand Down
3 changes: 1 addition & 2 deletions widget/nsBaseWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,7 @@ class nsBaseWidget : public nsIWidget, public nsSupportsWeakReference
int32_t aPanelX, int32_t aPanelY,
nsString& aCommitted) override
{ return NS_ERROR_NOT_IMPLEMENTED; }
NS_IMETHOD SetPluginFocused(bool& aFocused) override
{ return NS_ERROR_NOT_IMPLEMENTED; }
virtual void SetPluginFocused(bool& aFocused) override {}
virtual void SetCandidateWindowForPlugin(
const mozilla::widget::CandidateWindowPosition&
aPosition) override
Expand Down
2 changes: 1 addition & 1 deletion widget/nsIWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ class nsIWidget : public nsISupports
*
* aFocused Whether or not a plugin is focused
*/
NS_IMETHOD SetPluginFocused(bool& aFocused) = 0;
virtual void SetPluginFocused(bool& aFocused) = 0;

/*
* Tell the plugin has focus. It is unnecessary to use IPC
Expand Down

0 comments on commit c2fd85e

Please sign in to comment.