| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) | 2 * Copyright (C) 2000 Harri Porten (porten@kde.org) |
| 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) | 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) |
| 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) | 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. |
| 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Lesser General Public | 9 * modify it under the terms of the GNU Lesser General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 { | 38 { |
| 39 } | 39 } |
| 40 | 40 |
| 41 const char* NavigatorGeolocation::supplementName() | 41 const char* NavigatorGeolocation::supplementName() |
| 42 { | 42 { |
| 43 return "NavigatorGeolocation"; | 43 return "NavigatorGeolocation"; |
| 44 } | 44 } |
| 45 | 45 |
| 46 NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) | 46 NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) |
| 47 { | 47 { |
| 48 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(HeapSu
pplement<Navigator>::from(navigator, supplementName())); | 48 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(Supple
ment<Navigator>::from(navigator, supplementName())); |
| 49 if (!supplement) { | 49 if (!supplement) { |
| 50 supplement = new NavigatorGeolocation(navigator.frame()); | 50 supplement = new NavigatorGeolocation(navigator.frame()); |
| 51 provideTo(navigator, supplementName(), supplement); | 51 provideTo(navigator, supplementName(), supplement); |
| 52 } | 52 } |
| 53 return *supplement; | 53 return *supplement; |
| 54 } | 54 } |
| 55 | 55 |
| 56 Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) | 56 Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) |
| 57 { | 57 { |
| 58 return NavigatorGeolocation::from(navigator).geolocation(); | 58 return NavigatorGeolocation::from(navigator).geolocation(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 Geolocation* NavigatorGeolocation::geolocation() | 61 Geolocation* NavigatorGeolocation::geolocation() |
| 62 { | 62 { |
| 63 if (!m_geolocation && frame()) | 63 if (!m_geolocation && frame()) |
| 64 m_geolocation = Geolocation::create(frame()->document()); | 64 m_geolocation = Geolocation::create(frame()->document()); |
| 65 return m_geolocation.get(); | 65 return m_geolocation.get(); |
| 66 } | 66 } |
| 67 | 67 |
| 68 DEFINE_TRACE(NavigatorGeolocation) | 68 DEFINE_TRACE(NavigatorGeolocation) |
| 69 { | 69 { |
| 70 visitor->trace(m_geolocation); | 70 visitor->trace(m_geolocation); |
| 71 HeapSupplement<Navigator>::trace(visitor); | 71 Supplement<Navigator>::trace(visitor); |
| 72 DOMWindowProperty::trace(visitor); | 72 DOMWindowProperty::trace(visitor); |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |