diff options
author | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 13:58:48 +0000 |
---|---|---|
committer | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 13:58:48 +0000 |
commit | ecad7768a4f40e1ff1a6f1634d18a68358978cdb (patch) | |
tree | 78f530436257f410d8fa153c40cae5b35714ff0f /chrome/renderer/geolocation_dispatcher_old.h | |
parent | 70372d49ac0fc1bbfd7e04aa820b646a6c525743 (diff) | |
download | chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.zip chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.tar.gz chromium_src-ecad7768a4f40e1ff1a6f1634d18a68358978cdb.tar.bz2 |
Geolocation dispatcher rename:
Rename GeolocationDispatcherHost to GeolocationDispatcherHostOld and GeolocationDispatcher to GeolocationDispatcherOld in preparation for the new client-based implementation.
BUG=59908
TEST=None
Review URL: http://codereview.chromium.org/3799010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63507 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/geolocation_dispatcher_old.h')
-rw-r--r-- | chrome/renderer/geolocation_dispatcher_old.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/chrome/renderer/geolocation_dispatcher_old.h b/chrome/renderer/geolocation_dispatcher_old.h new file mode 100644 index 0000000..41473f3 --- /dev/null +++ b/chrome/renderer/geolocation_dispatcher_old.h @@ -0,0 +1,62 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ +#define CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ +#pragma once + +#include "base/basictypes.h" +#include "base/id_map.h" +#include "ipc/ipc_message.h" +#include "googleurl/src/gurl.h" +#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationService.h" + +class GURL; +class RenderView; +struct Geoposition; + +// GeolocationDispatcherOld is a delegate for Geolocation messages used by +// WebKit. +// It's the complement of GeolocationDispatcherHostOld (owned by +// RenderViewHost). + +// TODO(jknotten): Remove this class once the new client-based implementation is +// checked in (see http://crbug.com/59908). +class GeolocationDispatcherOld : public WebKit::WebGeolocationService { + public: + explicit GeolocationDispatcherOld(RenderView* render_view); + virtual ~GeolocationDispatcherOld(); + + // Called to possibly handle the incoming IPC message. Returns true if + // handled. Called in render thread. + bool OnMessageReceived(const IPC::Message& msg); + + // WebKit::WebGeolocationService. + void requestPermissionForFrame(int bridge_id, const WebKit::WebURL& url); + void cancelPermissionRequestForFrame( + int bridge_id, const WebKit::WebURL& url); + void startUpdating( + int bridge_id, const WebKit::WebURL& url, bool enableHighAccuracy); + void stopUpdating(int bridge_id); + void suspend(int bridge_id); + void resume(int bridge_id); + int attachBridge(WebKit::WebGeolocationServiceBridge* geolocation_service); + void detachBridge(int bridge_id); + + private: + // Permission for using geolocation has been set. + void OnGeolocationPermissionSet(int bridge_id, bool is_allowed); + + // We have an updated geolocation position or error code. + void OnGeolocationPositionUpdated(const Geoposition& geoposition); + + RenderView* render_view_; + + // The geolocation services attached to this dispatcher. + IDMap<WebKit::WebGeolocationServiceBridge> bridges_map_; + + DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherOld); +}; + +#endif // CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ |