| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 const char* NavigatorGeolocation::supplementName() | 40 const char* NavigatorGeolocation::supplementName() |
| 41 { | 41 { |
| 42 return "NavigatorGeolocation"; | 42 return "NavigatorGeolocation"; |
| 43 } | 43 } |
| 44 | 44 |
| 45 NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) | 45 NavigatorGeolocation& NavigatorGeolocation::from(Navigator& navigator) |
| 46 { | 46 { |
| 47 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(WillBe
HeapSupplement<Navigator>::from(navigator, supplementName())); | 47 NavigatorGeolocation* supplement = static_cast<NavigatorGeolocation*>(WillBe
HeapSupplement<Navigator>::from(navigator, supplementName())); |
| 48 if (!supplement) { | 48 if (!supplement) { |
| 49 supplement = new NavigatorGeolocation(navigator.frame()); | 49 supplement = new NavigatorGeolocation(navigator.localFrame()); |
| 50 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); | 50 provideTo(navigator, supplementName(), adoptPtrWillBeNoop(supplement)); |
| 51 } | 51 } |
| 52 return *supplement; | 52 return *supplement; |
| 53 } | 53 } |
| 54 | 54 |
| 55 Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) | 55 Geolocation* NavigatorGeolocation::geolocation(Navigator& navigator) |
| 56 { | 56 { |
| 57 return NavigatorGeolocation::from(navigator).geolocation(); | 57 return NavigatorGeolocation::from(navigator).geolocation(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 Geolocation* NavigatorGeolocation::geolocation() | 60 Geolocation* NavigatorGeolocation::geolocation() |
| 61 { | 61 { |
| 62 if (!m_geolocation && frame()) | 62 if (!m_geolocation && localFrame()) |
| 63 m_geolocation = Geolocation::create(frame()->document()); | 63 m_geolocation = Geolocation::create(localFrame()->document()); |
| 64 return m_geolocation.get(); | 64 return m_geolocation.get(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void NavigatorGeolocation::trace(Visitor* visitor) | 67 void NavigatorGeolocation::trace(Visitor* visitor) |
| 68 { | 68 { |
| 69 visitor->trace(m_geolocation); | 69 visitor->trace(m_geolocation); |
| 70 WillBeHeapSupplement<Navigator>::trace(visitor); | 70 WillBeHeapSupplement<Navigator>::trace(visitor); |
| 71 DOMWindowProperty::trace(visitor); | 71 DOMWindowProperty::trace(visitor); |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |