PageRenderTime 25ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/indra/newview/llbrowsernotification.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 58 lines | 27 code | 6 blank | 25 comment | 6 complexity | 17986ee591d99300c548d2dd39734964 MD5 | raw file
Possible License(s): LGPL-2.1
  1. /**
  2. * @file llbrowsernotification.cpp
  3. * @brief Notification Handler Class for browser popups
  4. *
  5. * $LicenseInfo:firstyear=2000&license=viewerlgpl$
  6. * Second Life Viewer Source Code
  7. * Copyright (C) 2010, Linden Research, Inc.
  8. *
  9. * This library is free software; you can redistribute it and/or
  10. * modify it under the terms of the GNU Lesser General Public
  11. * License as published by the Free Software Foundation;
  12. * version 2.1 of the License only.
  13. *
  14. * This library is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  17. * Lesser General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU Lesser General Public
  20. * License along with this library; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  22. *
  23. * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
  24. * $/LicenseInfo$
  25. */
  26. #include "llviewerprecompiledheaders.h" // must be first include
  27. #include "llnotificationhandler.h"
  28. #include "llnotifications.h"
  29. #include "llmediactrl.h"
  30. #include "llviewermedia.h"
  31. #include "llviewermediafocus.h"
  32. using namespace LLNotificationsUI;
  33. bool LLBrowserNotification::processNotification(const LLSD& notify)
  34. {
  35. LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
  36. if (!notification) return false;
  37. LLUUID media_id = notification->getPayload()["media_id"].asUUID();
  38. LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(media_id);
  39. if (media_instance)
  40. {
  41. media_instance->showNotification(notification);
  42. }
  43. else if (LLViewerMediaFocus::instance().getControlsMediaID() == media_id)
  44. {
  45. LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(media_id);
  46. if (impl)
  47. {
  48. impl->showNotification(notification);
  49. }
  50. }
  51. return false;
  52. }