Esempio n. 1
0
  NS_OVERRIDE virtual bool
  RecvVibrate(const InfallibleTArray<unsigned int>& pattern,
              const InfallibleTArray<uint64> &id,
              PBrowserParent *browserParent)
  {
    // 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.
    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);
    hal::Vibrate(pattern, newID);
    return true;
  }
Esempio n. 2
0
 NS_OVERRIDE virtual bool
 RecvCancelVibrate(const InfallibleTArray<uint64> &id,
                   PBrowserParent *browserParent)
 {
   TabParent *tabParent = static_cast<TabParent*>(browserParent);
   nsCOMPtr<nsIDOMWindow> window =
     do_QueryInterface(tabParent->GetBrowserDOMWindow());
   WindowIdentifier newID(id, window);
   hal::CancelVibrate(newID);
   return true;
 }