Source/WebCore/ChangeLog

 12012-03-26 Mark Pilgrim <pilgrim@chromium.org>
 2
 3 GEOLOCATION should be implemented as Page Supplement
 4 https://bugs.webkit.org/show_bug.cgi?id=82228
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * Modules/geolocation/Geolocation.cpp:
 9 (WebCore::Geolocation::Geolocation):
 10 (WebCore::Geolocation::stop):
 11 (WebCore::Geolocation::lastPosition):
 12 (WebCore::Geolocation::requestPermission):
 13 (WebCore::Geolocation::startUpdating):
 14 (WebCore::Geolocation::stopUpdating):
 15 * Modules/geolocation/Geolocation.h:
 16 (WebCore):
 17 * Modules/geolocation/GeolocationController.cpp:
 18 (WebCore::GeolocationController::supplementName):
 19 (WebCore):
 20 (WebCore::provideGeolocationTo):
 21 * Modules/geolocation/GeolocationController.h:
 22 (GeolocationController):
 23 (WebCore::GeolocationController::from):
 24 * page/GeolocationClient.h:
 25 (WebCore):
 26 (GeolocationClient):
 27 * page/Page.cpp:
 28 (WebCore::Page::Page):
 29 (WebCore::Page::PageClients::PageClients):
 30 * page/Page.h:
 31 (WebCore):
 32 (PageClients):
 33 (Page):
 34
1352012-03-26 James Robinson <jamesr@chromium.org>
236
337 Scrollable plugins not registered properly in ScrollingCoordinator
112142

Source/WebCore/Modules/geolocation/Geolocation.cpp

@@PassRefPtr<Geolocation> Geolocation::cre
230230Geolocation::Geolocation(ScriptExecutionContext* context)
231231 : ActiveDOMObject(context, this)
232232 , m_allowGeolocation(Unknown)
 233 , m_geolocationController(GeolocationController::from(page()))
233234{
234235}
235236

@@void Geolocation::stop()
258259{
259260 Page* page = this->page();
260261 if (page && m_allowGeolocation == InProgress)
261  page->geolocationController()->cancelPermissionRequest(this);
 262 m_geolocationController->cancelPermissionRequest(this);
262263 // The frame may be moving to a new page and we want to get the permissions from the new page's client.
263264 m_allowGeolocation = Unknown;
264265 cancelAllRequests();

@@Geoposition* Geolocation::lastPosition()
274275 if (!page)
275276 return 0;
276277
277  m_lastPosition = createGeoposition(page->geolocationController()->lastPosition());
 278 m_lastPosition = createGeoposition(m_geolocationController->lastPosition());
278279
279280 return m_lastPosition.get();
280281}

@@void Geolocation::requestPermission()
604605 m_allowGeolocation = InProgress;
605606
606607 // Ask the embedder: it maintains the geolocation challenge policy itself.
607  page->geolocationController()->requestPermission(this);
 608 m_geolocationController->requestPermission(this);
608609}
609610
610611void Geolocation::positionChangedInternal()

@@bool Geolocation::startUpdating(GeoNotif
666667 if (!page)
667668 return false;
668669
669  page->geolocationController()->addObserver(this, notifier->m_options->enableHighAccuracy());
 670 m_geolocationController->addObserver(this, notifier->m_options->enableHighAccuracy());
670671 return true;
671672}
672673

@@void Geolocation::stopUpdating()
676677 if (!page)
677678 return;
678679
679  page->geolocationController()->removeObserver(this);
 680 m_geolocationController->removeObserver(this);
680681}
681682
682683#if USE(PREEMPT_GEOLOCATION_PERMISSION)
112126

Source/WebCore/Modules/geolocation/Geolocation.h

@@namespace WebCore {
4141
4242class Document;
4343class Frame;
44 class GeolocationPosition;
 44class GeolocationController;
4545class GeolocationError;
 46class GeolocationPosition;
4647class Page;
4748class ScriptExecutionContext;
4849

@@private:
170171 } m_allowGeolocation;
171172
172173 RefPtr<Geoposition> m_cachedPosition;
 174 GeolocationController* m_geolocationController;
173175 GeoNotifierSet m_requestsAwaitingCachedPosition;
174176};
175177
112126

Source/WebCore/Modules/geolocation/GeolocationController.cpp

@@GeolocationPosition* GeolocationControll
125125 return m_client->lastPosition();
126126}
127127
 128const AtomicString& GeolocationController::supplementName()
 129{
 130 DEFINE_STATIC_LOCAL(AtomicString, name, ("GeolocationController"));
 131 return name;
 132}
 133
 134void provideGeolocationTo(Page* page, GeolocationClient* client)
 135{
 136 Supplement<Page>::provideTo(page, GeolocationController::supplementName(), GeolocationController::create(page, client));
 137}
 138
128139} // namespace WebCore
129140
130141#endif // ENABLE(GEOLOCATION)
112126

Source/WebCore/Modules/geolocation/GeolocationController.h

2929#if ENABLE(GEOLOCATION)
3030
3131#include "Geolocation.h"
 32#include "Page.h"
3233#include <wtf/HashSet.h>
3334#include <wtf/Noncopyable.h>
3435#include <wtf/RefPtr.h>

@@class GeolocationError;
4041class GeolocationPosition;
4142class Page;
4243
43 class GeolocationController {
 44class GeolocationController : public Supplement<Page> {
4445 WTF_MAKE_NONCOPYABLE(GeolocationController);
4546public:
4647 ~GeolocationController();

@@public:
6061
6162 GeolocationClient* client() { return m_client; }
6263
 64 static const AtomicString& supplementName();
 65 static GeolocationController* from(Page* page) { return static_cast<GeolocationController*>(Supplement<Page>::from(page, supplementName())); }
 66
6367private:
6468 GeolocationController(Page*, GeolocationClient*);
6569
112126

Source/WebCore/page/GeolocationClient.h

@@namespace WebCore {
3030
3131class Geolocation;
3232class GeolocationPosition;
 33class Page;
3334
3435class GeolocationClient {
3536public:

@@public:
4748 virtual void requestPermission(Geolocation*) = 0;
4849 virtual void cancelPermissionRequest(Geolocation*) = 0;
4950
 51 void provideGeolocationTo(Page*, GeolocationClient*);
 52
5053protected:
5154 virtual ~GeolocationClient() { }
5255};
5356
 57void provideGeolocationTo(Page*, GeolocationClient*);
 58
5459} // namespace WebCore
5560
5661#endif // GeolocationClient_h
112126

Source/WebCore/page/Page.cpp

4343#include "FrameSelection.h"
4444#include "FrameTree.h"
4545#include "FrameView.h"
46 #include "GeolocationController.h"
4746#include "HTMLElement.h"
4847#include "HistoryItem.h"
4948#include "InspectorController.h"

@@Page::Page(PageClients& pageClients)
122121#if ENABLE(INSPECTOR)
123122 , m_inspectorController(InspectorController::create(this, pageClients.inspectorClient))
124123#endif
125 #if ENABLE(GEOLOCATION)
126  , m_geolocationController(GeolocationController::create(this, pageClients.geolocationClient))
127 #endif
128124#if ENABLE(POINTER_LOCK)
129125 , m_pointerLockController(PointerLockController::create(this))
130126#endif

@@Page::PageClients::PageClients()
11171113 , editorClient(0)
11181114 , dragClient(0)
11191115 , inspectorClient(0)
1120  , geolocationClient(0)
11211116{
11221117}
11231118
112126

Source/WebCore/page/Page.h

@@namespace WebCore {
6363 class FocusController;
6464 class Frame;
6565 class FrameSelection;
66  class GeolocationClient;
67  class GeolocationController;
6866 class HaltablePlugin;
6967 class HistoryItem;
7068 class InspectorClient;

@@namespace WebCore {
108106 EditorClient* editorClient;
109107 DragClient* dragClient;
110108 InspectorClient* inspectorClient;
111  GeolocationClient* geolocationClient;
112109 RefPtr<BackForwardList> backForwardClient;
113110 };
114111

@@namespace WebCore {
167164#if ENABLE(INSPECTOR)
168165 InspectorController* inspectorController() const { return m_inspectorController.get(); }
169166#endif
170 #if ENABLE(GEOLOCATION)
171  GeolocationController* geolocationController() const { return m_geolocationController.get(); }
172 #endif
173167#if ENABLE(POINTER_LOCK)
174168 PointerLockController* pointerLockController() const { return m_pointerLockController.get(); }
175169#endif

@@namespace WebCore {
359353#if ENABLE(INSPECTOR)
360354 OwnPtr<InspectorController> m_inspectorController;
361355#endif
362 #if ENABLE(GEOLOCATION)
363  OwnPtr<GeolocationController> m_geolocationController;
364 #endif
365356#if ENABLE(POINTER_LOCK)
366357 OwnPtr<PointerLockController> m_pointerLockController;
367358#endif
112126

Source/WebKit/chromium/ChangeLog

 12012-03-26 Mark Pilgrim <pilgrim@chromium.org>
 2
 3 GEOLOCATION should be implemented as Page Supplement
 4 https://bugs.webkit.org/show_bug.cgi?id=82228
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * src/WebViewImpl.cpp:
 9 (WebKit::WebViewImpl::WebViewImpl):
 10
1112012-03-26 James Robinson <jamesr@chromium.org>
212
313 Scrollable plugins not registered properly in ScrollingCoordinator
112142

Source/WebKit/chromium/src/WebViewImpl.cpp

@@WebViewImpl::WebViewImpl(WebViewClient*
383383 pageClients.editorClient = &m_editorClientImpl;
384384 pageClients.dragClient = &m_dragClientImpl;
385385 pageClients.inspectorClient = &m_inspectorClientImpl;
386  pageClients.geolocationClient = m_geolocationClientProxy.get();
387386 pageClients.backForwardClient = BackForwardListChromium::create(this);
388387
389388 m_page = adoptPtr(new Page(pageClients));

@@WebViewImpl::WebViewImpl(WebViewClient*
401400#endif
402401
403402 provideDeviceOrientationTo(m_page.get(), m_deviceOrientationClientProxy.get());
404  m_geolocationClientProxy->setController(m_page->geolocationController());
 403 provideGeolocationTo(m_page.get(), m_geolocationClientProxy.get());
405404
406405 m_page->setGroupName(pageGroupName);
407406
112126

Source/WebKit/win/ChangeLog

 12012-03-26 Mark Pilgrim <pilgrim@chromium.org>
 2
 3 GEOLOCATION should be implemented as Page Supplement
 4 https://bugs.webkit.org/show_bug.cgi?id=82228
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 * WebView.cpp:
 9 (WebView::initWithFrame):
 10
1112012-03-22 Anders Carlsson <andersca@apple.com>
212
313 ASSERT(!needsLayout) in RenderView.cpp when visiting http://www.panic.com/blog/
112142

Source/WebKit/win/WebView.cpp

@@HRESULT STDMETHODCALLTYPE WebView::initW
26662666 pageClients.editorClient = new WebEditorClient(this);
26672667 pageClients.dragClient = new WebDragClient(this);
26682668 pageClients.inspectorClient = m_inspectorClient;
2669  pageClients.geolocationClient = new WebGeolocationClient(this);
26702669 m_page = new Page(pageClients);
 2670 provideGeolocationTo(m_page.get(), new WebGeolocationClient(this));
26712671
26722672 BSTR localStoragePath;
26732673 if (SUCCEEDED(m_preferences->localStorageDatabasePath(&localStoragePath))) {
112126