RootAccessibleWrap.cpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #include "RootAccessibleWrap.h"
  6. #include "Compatibility.h"
  7. #include "nsCoreUtils.h"
  8. #include "nsWinUtils.h"
  9. using namespace mozilla::a11y;
  10. ////////////////////////////////////////////////////////////////////////////////
  11. // Constructor/destructor
  12. RootAccessibleWrap::
  13. RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell) :
  14. RootAccessible(aDocument, aPresShell)
  15. {
  16. }
  17. RootAccessibleWrap::~RootAccessibleWrap()
  18. {
  19. }
  20. ////////////////////////////////////////////////////////////////////////////////
  21. // RootAccessible
  22. void
  23. RootAccessibleWrap::DocumentActivated(DocAccessible* aDocument)
  24. {
  25. if (Compatibility::IsDolphin() &&
  26. nsCoreUtils::IsTabDocument(aDocument->DocumentNode())) {
  27. uint32_t count = mChildDocuments.Length();
  28. for (uint32_t idx = 0; idx < count; idx++) {
  29. DocAccessible* childDoc = mChildDocuments[idx];
  30. HWND childDocHWND = static_cast<HWND>(childDoc->GetNativeWindow());
  31. if (childDoc != aDocument)
  32. nsWinUtils::HideNativeWindow(childDocHWND);
  33. else
  34. nsWinUtils::ShowNativeWindow(childDocHWND);
  35. }
  36. }
  37. }