tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DocAccessibleWrap.cpp (1222B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "DocAccessibleWrap.h"
      8 #include "mozilla/PresShell.h"
      9 #include "nsIWidgetListener.h"
     10 #include "nsTArray.h"
     11 #include "nsWindow.h"
     12 
     13 using namespace mozilla;
     14 using namespace mozilla::a11y;
     15 
     16 ////////////////////////////////////////////////////////////////////////////////
     17 // DocAccessibleWrap
     18 ////////////////////////////////////////////////////////////////////////////////
     19 
     20 DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument,
     21                                     PresShell* aPresShell)
     22    : DocAccessible(aDocument, aPresShell) {}
     23 
     24 DocAccessibleWrap::~DocAccessibleWrap() {}
     25 
     26 bool DocAccessibleWrap::IsActivated() {
     27  if (nsWindow* window = nsWindow::GetFocusedWindow()) {
     28    if (nsIWidgetListener* listener = window->GetWidgetListener()) {
     29      if (PresShell* presShell = listener->GetPresShell()) {
     30        return presShell == PresShellPtr();
     31      }
     32    }
     33  }
     34 
     35  return false;
     36 }