Bug 791261 - Remove the requirement that a TabParent must be Active in order to send vibrations. Also remove TabParent::Active(). r=cjones

This commit is contained in:
Justin Lebar 2012-09-19 09:48:38 -04:00
Родитель a7bb18e932
Коммит b7559be095
3 изменённых файлов: 0 добавлений и 32 удалений

Просмотреть файл

@ -84,7 +84,6 @@ TabParent::TabParent(mozIApplication* aApp, bool aIsBrowserElement)
, mIMESeqno(0)
, mEventCaptureDepth(0)
, mDPI(0)
, mActive(false)
, mIsBrowserElement(aIsBrowserElement)
, mShown(false)
{
@ -260,23 +259,15 @@ void TabParent::HandleSingleTap(const nsIntPoint& aPoint)
void
TabParent::Activate()
{
mActive = true;
unused << SendActivate();
}
void
TabParent::Deactivate()
{
mActive = false;
unused << SendDeactivate();
}
bool
TabParent::Active()
{
return mActive;
}
NS_IMETHODIMP
TabParent::Init(nsIDOMWindow *window)
{

Просмотреть файл

@ -156,12 +156,6 @@ public:
void Activate();
void Deactivate();
/**
* Is this object active? That is, was Activate() called more recently than
* Deactivate()?
*/
bool Active();
void SendMouseEvent(const nsAString& aType, float aX, float aY,
int32_t aButton, int32_t aClickCount,
int32_t aModifiers, bool aIgnoreRootScrollFrame);
@ -275,7 +269,6 @@ protected:
int32_t mEventCaptureDepth;
float mDPI;
bool mActive;
bool mIsBrowserElement;
bool mShown;

Просмотреть файл

@ -325,23 +325,7 @@ public:
PBrowserParent *browserParent) MOZ_OVERRIDE
{
// We give all content vibration permission.
// Check whether browserParent is active. We should have already
// checked that the corresponding window is active, but this check
// isn't redundant. A window may be inactive in an active
// browser. And a window is not notified synchronously when it's
// deactivated, so the window may think it's active when the tab
// is actually inactive. This also mitigates user annoyance that
// buggy/malicious processes could cause.
TabParent *tabParent = static_cast<TabParent*>(browserParent);
if (!tabParent->Active()) {
HAL_LOG(("RecvVibrate: Tab is not active. Cancelling."));
return true;
}
// Forward to hal::, not hal_impl::, because we might be a
// subprocess of another sandboxed process. The hal:: entry point
// will do the right thing.
nsCOMPtr<nsIDOMWindow> window =
do_QueryInterface(tabParent->GetBrowserDOMWindow());
WindowIdentifier newID(id, window);