diff options
author | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-14 17:26:33 +0000 |
---|---|---|
committer | jknotten@chromium.org <jknotten@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-14 17:26:33 +0000 |
commit | 24ebb8c857a6c479854c328b9d5b0bc44292f415 (patch) | |
tree | aaadc1d40e9eff51c112428c418f77d0bdb58c75 | |
parent | 878761aef2460c1c2b8922e3e4c5da234f5c7b60 (diff) | |
download | chromium_src-24ebb8c857a6c479854c328b9d5b0bc44292f415.zip chromium_src-24ebb8c857a6c479854c328b9d5b0bc44292f415.tar.gz chromium_src-24ebb8c857a6c479854c328b9d5b0bc44292f415.tar.bz2 |
Revert rev 69137 due to incorrect change log.
BUG=None
TEST=None
Review URL: http://codereview.chromium.org/5744005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@69152 0039d316-1c4b-4281-b951-d872f2087c98
24 files changed, 102 insertions, 456 deletions
diff --git a/build/features_override.gypi b/build/features_override.gypi index dc59950..5c069ea 100644 --- a/build/features_override.gypi +++ b/build/features_override.gypi @@ -15,7 +15,6 @@ 'ENABLE_BLOB=1', 'ENABLE_BLOB_SLICE=1', 'ENABLE_CHANNEL_MESSAGING=1', - 'ENABLE_CLIENT_BASED_GEOLOCATION=0', 'ENABLE_DASHBOARD_SUPPORT=0', 'ENABLE_DATABASE=1', 'ENABLE_DATAGRID=0', diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host.h b/chrome/browser/geolocation/geolocation_dispatcher_host.h deleted file mode 100644 index 293cb33..0000000 --- a/chrome/browser/geolocation/geolocation_dispatcher_host.h +++ /dev/null @@ -1,31 +0,0 @@ -// 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_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ -#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ -#pragma once - -#include "chrome/browser/browser_message_filter.h" - -class GeolocationPermissionContext; - -// GeolocationDispatcherHost is a browser filter for Geolocation messages. -// It's the complement of GeolocationDispatcher (owned by RenderView). - -class GeolocationDispatcherHost : public BrowserMessageFilter { - public: - static GeolocationDispatcherHost* New( - int render_process_id, - GeolocationPermissionContext* geolocation_permission_context); - - virtual bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok) = 0; - - protected: - GeolocationDispatcherHost() {} - virtual ~GeolocationDispatcherHost() {} - - DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHost); -}; - -#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_H_ diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host.cc b/chrome/browser/geolocation/geolocation_dispatcher_host_old.cc index 4f4020b3..ca5298d 100644 --- a/chrome/browser/geolocation/geolocation_dispatcher_host.cc +++ b/chrome/browser/geolocation/geolocation_dispatcher_host_old.cc @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "chrome/browser/geolocation/geolocation_dispatcher_host.h" +#include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" #include <map> #include <set> @@ -19,21 +19,24 @@ #include "ipc/ipc_message.h" namespace { -class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, - public GeolocationObserver { +class GeolocationDispatcherHostOldImpl : public GeolocationDispatcherHostOld, + public GeolocationObserver { public: - GeolocationDispatcherHostImpl( - int render_process_id, + GeolocationDispatcherHostOldImpl( + int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context); - // GeolocationDispatcherHost + // GeolocationDispatcherHostOld + // Called to possibly handle the incoming IPC message. Returns true if + // handled. Called in the browser process. virtual bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok); - // GeolocationObserver + // GeolocationArbitrator::Delegate virtual void OnLocationUpdate(const Geoposition& position); private: - virtual ~GeolocationDispatcherHostImpl(); + friend class base::RefCountedThreadSafe<GeolocationDispatcherHostOldImpl>; + virtual ~GeolocationDispatcherHostOldImpl(); void OnRegisterDispatcher(int render_view_id); void OnUnregisterDispatcher(int render_view_id); @@ -52,7 +55,7 @@ class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, // options, based on |bridge_update_options_|. void RefreshGeolocationObserverOptions(); - int render_process_id_; + int resource_message_filter_process_id_; scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; // Iterated when sending location updates to renderer processes. The fan out @@ -67,13 +70,13 @@ class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, // Only set whilst we are registered with the arbitrator. GeolocationProvider* location_provider_; - DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostImpl); + DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostOldImpl); }; -GeolocationDispatcherHostImpl::GeolocationDispatcherHostImpl( - int render_process_id, +GeolocationDispatcherHostOldImpl::GeolocationDispatcherHostOldImpl( + int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context) - : render_process_id_(render_process_id), + : resource_message_filter_process_id_(resource_message_filter_process_id), geolocation_permission_context_(geolocation_permission_context), location_provider_(NULL) { // This is initialized by ResourceMessageFilter. Do not add any non-trivial @@ -81,17 +84,17 @@ GeolocationDispatcherHostImpl::GeolocationDispatcherHostImpl( // a javascript geolocation object is actually initialized. } -GeolocationDispatcherHostImpl::~GeolocationDispatcherHostImpl() { +GeolocationDispatcherHostOldImpl::~GeolocationDispatcherHostOldImpl() { if (location_provider_) location_provider_->RemoveObserver(this); } -bool GeolocationDispatcherHostImpl::OnMessageReceived( +bool GeolocationDispatcherHostOldImpl::OnMessageReceived( const IPC::Message& msg, bool* msg_was_ok) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); *msg_was_ok = true; bool handled = true; - IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostImpl, msg, *msg_was_ok) + IPC_BEGIN_MESSAGE_MAP_EX(GeolocationDispatcherHostOldImpl, msg, *msg_was_ok) IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_RegisterDispatcher, OnRegisterDispatcher) IPC_MESSAGE_HANDLER(ViewHostMsg_Geolocation_UnregisterDispatcher, @@ -113,112 +116,103 @@ bool GeolocationDispatcherHostImpl::OnMessageReceived( return handled; } -void GeolocationDispatcherHostImpl::OnLocationUpdate( +void GeolocationDispatcherHostOldImpl::OnLocationUpdate( const Geoposition& geoposition) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); for (std::set<int>::iterator it = geolocation_renderer_ids_.begin(); it != geolocation_renderer_ids_.end(); ++it) { IPC::Message* message = new ViewMsg_Geolocation_PositionUpdated(*it, geoposition); - CallRenderViewHost(render_process_id_, *it, + CallRenderViewHost(resource_message_filter_process_id_, *it, &RenderViewHost::Send, message); } } -void GeolocationDispatcherHostImpl::OnRegisterDispatcher( +void GeolocationDispatcherHostOldImpl::OnRegisterDispatcher( int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(0u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.insert(render_view_id); } -void GeolocationDispatcherHostImpl::OnUnregisterDispatcher( +void GeolocationDispatcherHostOldImpl::OnUnregisterDispatcher( int render_view_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); DCHECK_EQ(1u, geolocation_renderer_ids_.count(render_view_id)); geolocation_renderer_ids_.erase(render_view_id); } -void GeolocationDispatcherHostImpl::OnRequestPermission( +void GeolocationDispatcherHostOldImpl::OnRequestPermission( int render_view_id, int bridge_id, const GURL& requesting_frame) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; geolocation_permission_context_->RequestGeolocationPermission( - render_process_id_, render_view_id, bridge_id, + resource_message_filter_process_id_, render_view_id, bridge_id, requesting_frame); } -void GeolocationDispatcherHostImpl::OnCancelPermissionRequest( +void GeolocationDispatcherHostOldImpl::OnCancelPermissionRequest( int render_view_id, int bridge_id, const GURL& requesting_frame) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; geolocation_permission_context_->CancelGeolocationPermissionRequest( - render_process_id_, render_view_id, bridge_id, + resource_message_filter_process_id_, render_view_id, bridge_id, requesting_frame); } -void GeolocationDispatcherHostImpl::OnStartUpdating( +void GeolocationDispatcherHostOldImpl::OnStartUpdating( int render_view_id, int bridge_id, const GURL& requesting_frame, bool enable_high_accuracy) { -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - // StartUpdating() can be invoked as a result of high-accuracy mode - // being enabled / disabled. No need to register the dispatcher again. - if (!geolocation_renderer_ids_.count(render_view_id)) - OnRegisterDispatcher(render_view_id); -#endif // WebKit sends the startupdating request before checking permissions, to // optimize the no-location-available case and reduce latency in the success // case (location lookup happens in parallel with the permission request). DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; bridge_update_options_[std::make_pair(render_view_id, bridge_id)] = GeolocationObserverOptions(enable_high_accuracy); geolocation_permission_context_->StartUpdatingRequested( - render_process_id_, render_view_id, bridge_id, + resource_message_filter_process_id_, render_view_id, bridge_id, requesting_frame); RefreshGeolocationObserverOptions(); } -void GeolocationDispatcherHostImpl::OnStopUpdating(int render_view_id, +void GeolocationDispatcherHostOldImpl::OnStopUpdating(int render_view_id, int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; if (bridge_update_options_.erase(std::make_pair(render_view_id, bridge_id))) RefreshGeolocationObserverOptions(); geolocation_permission_context_->StopUpdatingRequested( - render_process_id_, render_view_id, bridge_id); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - OnUnregisterDispatcher(render_view_id); -#endif + resource_message_filter_process_id_, render_view_id, bridge_id); } -void GeolocationDispatcherHostImpl::OnSuspend(int render_view_id, +void GeolocationDispatcherHostOldImpl::OnSuspend(int render_view_id, int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. } -void GeolocationDispatcherHostImpl::OnResume(int render_view_id, +void GeolocationDispatcherHostOldImpl::OnResume(int render_view_id, int bridge_id) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); - DVLOG(1) << __FUNCTION__ << " " << render_process_id_ << ":" + DVLOG(1) << __FUNCTION__ << " " << resource_message_filter_process_id_ << ":" << render_view_id << ":" << bridge_id; // TODO(bulach): connect this with GeolocationArbitrator. } -void GeolocationDispatcherHostImpl::RefreshGeolocationObserverOptions() { +void GeolocationDispatcherHostOldImpl::RefreshGeolocationObserverOptions() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); if (bridge_update_options_.empty()) { if (location_provider_) { @@ -236,10 +230,10 @@ void GeolocationDispatcherHostImpl::RefreshGeolocationObserverOptions() { } } // namespace -GeolocationDispatcherHost* GeolocationDispatcherHost::New( - int render_process_id, +GeolocationDispatcherHostOld* GeolocationDispatcherHostOld::New( + int resource_message_filter_process_id, GeolocationPermissionContext* geolocation_permission_context) { - return new GeolocationDispatcherHostImpl( - render_process_id, + return new GeolocationDispatcherHostOldImpl( + resource_message_filter_process_id, geolocation_permission_context); } diff --git a/chrome/browser/geolocation/geolocation_dispatcher_host_old.h b/chrome/browser/geolocation/geolocation_dispatcher_host_old.h new file mode 100644 index 0000000..655049a --- /dev/null +++ b/chrome/browser/geolocation/geolocation_dispatcher_host_old.h @@ -0,0 +1,39 @@ +// 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_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ +#define CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ +#pragma once + +#include "base/ref_counted.h" + +class GeolocationPermissionContext; +namespace IPC { class Message; } + +// GeolocationDispatcherHostOld is a delegate for Geolocation messages used by +// ResourceMessageFilter. +// It's the complement of GeolocationDispatcher (owned by RenderView). + +// TODO(jknotten): Remove this class once the new client-based implementation is +// checked in (see http://crbug.com/59908). +class GeolocationDispatcherHostOld + : public base::RefCountedThreadSafe<GeolocationDispatcherHostOld> { + public: + static GeolocationDispatcherHostOld* New( + int resource_message_filter_process_id, + GeolocationPermissionContext* geolocation_permission_context); + + // Called to possibly handle the incoming IPC message. Returns true if + // handled. Called in the browser process. + virtual bool OnMessageReceived(const IPC::Message& msg, bool* msg_was_ok) = 0; + + protected: + friend class base::RefCountedThreadSafe<GeolocationDispatcherHostOld>; + GeolocationDispatcherHostOld() {} + virtual ~GeolocationDispatcherHostOld() {} + + DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherHostOld); +}; + +#endif // CHROME_BROWSER_GEOLOCATION_GEOLOCATION_DISPATCHER_HOST_OLD_H_ diff --git a/chrome/browser/geolocation/geolocation_permission_context.cc b/chrome/browser/geolocation/geolocation_permission_context.cc index 1f8160d..2a8e542 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.cc +++ b/chrome/browser/geolocation/geolocation_permission_context.cc @@ -10,6 +10,7 @@ #include "chrome/browser/browser_thread.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/geolocation/geolocation_content_settings_map.h" +#include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" #include "chrome/browser/geolocation/geolocation_provider.h" #include "chrome/browser/google/google_util.h" #include "chrome/browser/prefs/pref_service.h" @@ -439,12 +440,6 @@ void GeolocationPermissionContext::StartUpdatingRequested( // Note we cannot store the arbitrator as a member as it is not thread safe. GeolocationProvider* provider = GeolocationProvider::GetInstance(); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - // Client-based Geolocation uses a preemptive permission model, so permission - // ought to have been requested and granted before the controller requests - // the client to start updating. - DCHECK(provider->HasPermissionBeenGranted()); -#else // WebKit will not request permission until it has received a valid // location, but the google network location provider will not give a // valid location until the user has granted permission. So we cut the Gordian @@ -454,14 +449,11 @@ void GeolocationPermissionContext::StartUpdatingRequested( RequestGeolocationPermission(render_process_id, render_view_id, bridge_id, requesting_frame); } -#endif } void GeolocationPermissionContext::StopUpdatingRequested( int render_process_id, int render_view_id, int bridge_id) { -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) CancelPendingInfoBarRequest(render_process_id, render_view_id, bridge_id); -#endif } void GeolocationPermissionContext::NotifyPermissionSet( diff --git a/chrome/browser/geolocation/geolocation_permission_context.h b/chrome/browser/geolocation/geolocation_permission_context.h index c2a08e7..432c9a2 100644 --- a/chrome/browser/geolocation/geolocation_permission_context.h +++ b/chrome/browser/geolocation/geolocation_permission_context.h @@ -46,7 +46,7 @@ class GeolocationPermissionContext // Called when a geolocation object wants to start receiving location updates. // This also applies global policy around which location providers may be - // enabled at a given time (e.g. prior to the user agreeing to any geolocation + // enbaled at a given time (e.g. prior to the user agreeing to any geolocation // permission requests). void StartUpdatingRequested( int render_process_id, int render_view_id, int bridge_id, diff --git a/chrome/browser/geolocation/mock_location_provider.cc b/chrome/browser/geolocation/mock_location_provider.cc index e3575f0..689ab9c 100644 --- a/chrome/browser/geolocation/mock_location_provider.cc +++ b/chrome/browser/geolocation/mock_location_provider.cc @@ -78,9 +78,7 @@ class AutoMockLocationProvider : public MockLocationProvider { position_.accuracy = 3; position_.latitude = 4.3; position_.longitude = -7.8; - // Webkit compares the timestamp to wall clock time, so we need it to be - // contemporary. - position_.timestamp = base::Time::Now(); + position_.timestamp = base::Time::FromDoubleT(4567.8); } else { position_.error_code = Geoposition::ERROR_CODE_POSITION_UNAVAILABLE; } diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 61849ec..cb3eb82 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -37,7 +37,6 @@ #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/extensions/user_script_master.h" #include "chrome/browser/file_system/file_system_dispatcher_host.h" -#include "chrome/browser/geolocation/geolocation_dispatcher_host.h" #include "chrome/browser/gpu_process_host.h" #include "chrome/browser/history/history.h" #include "chrome/browser/in_process_webkit/dom_storage_message_filter.h" @@ -401,9 +400,6 @@ void BrowserRenderProcessHost::CreateMessageFilters() { new AppCacheDispatcherHost(profile()->GetRequestContext(), id())); channel_->AddFilter(new DOMStorageMessageFilter(id(), profile())); channel_->AddFilter(new IndexedDBDispatcherHost(id(), profile())); - channel_->AddFilter( - GeolocationDispatcherHost::New( - id(), profile()->GetGeolocationPermissionContext())); channel_->AddFilter(new PepperFileMessageFilter(id(), profile())); channel_->AddFilter(new speech_input::SpeechInputDispatcherHost(id())); channel_->AddFilter( diff --git a/chrome/browser/renderer_host/render_message_filter.cc b/chrome/browser/renderer_host/render_message_filter.cc index 5fa92ec..6f12cdd 100644 --- a/chrome/browser/renderer_host/render_message_filter.cc +++ b/chrome/browser/renderer_host/render_message_filter.cc @@ -21,7 +21,8 @@ #include "chrome/browser/clipboard_dispatcher.h" #include "chrome/browser/download/download_types.h" #include "chrome/browser/extensions/extension_message_service.h" -#include "chrome/browser/file_system/file_system_dispatcher_host.h" +#include "chrome/browser/geolocation/geolocation_dispatcher_host_old.h" +#include "chrome/browser/geolocation/geolocation_permission_context.h" #include "chrome/browser/gpu_process_host.h" #include "chrome/browser/host_zoom_map.h" #include "chrome/browser/metrics/histogram_synchronizer.h" @@ -250,6 +251,9 @@ RenderMessageFilter::RenderMessageFilter( off_the_record_(profile->IsOffTheRecord()), next_route_id_callback_(NewCallbackWithReturnValue( render_widget_helper, &RenderWidgetHelper::GetNextRoutingID)), + ALLOW_THIS_IN_INITIALIZER_LIST(geolocation_dispatcher_host_( + GeolocationDispatcherHostOld::New( + this->id(), profile->GetGeolocationPermissionContext()))), webkit_context_(profile->GetWebKitContext()) { request_context_ = profile_->GetRequestContext(); DCHECK(request_context_); @@ -320,7 +324,8 @@ bool RenderMessageFilter::OnMessageReceived(const IPC::Message& msg) { bool handled = resource_dispatcher_host_->OnMessageReceived(msg, this, &msg_is_ok) || mp_dispatcher->OnMessageReceived( - msg, this, next_route_id_callback(), &msg_is_ok); + msg, this, next_route_id_callback(), &msg_is_ok) || + geolocation_dispatcher_host_->OnMessageReceived(msg, &msg_is_ok); if (!handled) { DCHECK(msg_is_ok); // It should have been marked handled if it wasn't OK. diff --git a/chrome/browser/renderer_host/render_message_filter.h b/chrome/browser/renderer_host/render_message_filter.h index e912aaa..69bc8f7 100644 --- a/chrome/browser/renderer_host/render_message_filter.h +++ b/chrome/browser/renderer_host/render_message_filter.h @@ -34,6 +34,7 @@ class ChromeURLRequestContext; struct FontDescriptor; +class GeolocationDispatcherHostOld; class HostZoomMap; class NotificationsPrefsCache; class PpapiPluginProcessHost; @@ -448,6 +449,8 @@ class RenderMessageFilter : public IPC::ChannelProxy::MessageFilter, // A callback to create a routing id for the associated renderer process. scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; + // Used to handle geolocation-related messages. + scoped_refptr<GeolocationDispatcherHostOld> geolocation_dispatcher_host_; scoped_refptr<WebKitContext> webkit_context_; diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index 5a6fbb7..ac54cfb 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -1259,8 +1259,8 @@ 'browser/geolocation/gateway_data_provider_win.h', 'browser/geolocation/geolocation_content_settings_map.cc', 'browser/geolocation/geolocation_content_settings_map.h', - 'browser/geolocation/geolocation_dispatcher_host.cc', - 'browser/geolocation/geolocation_dispatcher_host.h', + 'browser/geolocation/geolocation_dispatcher_host_old.cc', + 'browser/geolocation/geolocation_dispatcher_host_old.h', 'browser/geolocation/geolocation_exceptions_table_model.cc', 'browser/geolocation/geolocation_exceptions_table_model.h', 'browser/geolocation/geolocation_observer.h', @@ -4349,14 +4349,6 @@ 'browser/importer/nss_decryptor_system_nss.h', ], }], - # We are migrating to client-based geolocation. Once the migration - # has finished, ENABLE_CLIENT_BASED_GEOLOCATION will disappear. - # See bugs: - # https://bugs.webkit.org/show_bug.cgi?id=45752 and - # http://code.google.com/p/chromium/issues/detail?id=59907 - ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', { - 'defines': [ 'ENABLE_CLIENT_BASED_GEOLOCATION=1' ] - }], ], }, { diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index 2a69cd7..87889aa 100644 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -112,8 +112,6 @@ 'renderer/external_extension.h', 'renderer/form_manager.cc', 'renderer/form_manager.h', - 'renderer/geolocation_dispatcher.cc', - 'renderer/geolocation_dispatcher.h', 'renderer/geolocation_dispatcher_old.cc', 'renderer/geolocation_dispatcher_old.h', 'renderer/gpu_channel_host.cc', @@ -314,14 +312,6 @@ 'renderer/command_buffer_proxy.h', ], }], - # We are migrating to client-based geolocation. Once the migration - # has finished, ENABLE_CLIENT_BASED_GEOLOCATION will disappear. - # See bugs: - # https://bugs.webkit.org/show_bug.cgi?id=45752 and - # http://code.google.com/p/chromium/issues/detail?id=59907 - ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', { - 'defines': [ 'ENABLE_CLIENT_BASED_GEOLOCATION=1' ] - }], ], }, { diff --git a/chrome/renderer/geolocation_dispatcher.cc b/chrome/renderer/geolocation_dispatcher.cc deleted file mode 100644 index 39596af..0000000 --- a/chrome/renderer/geolocation_dispatcher.cc +++ /dev/null @@ -1,155 +0,0 @@ -// 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. - -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - -#include "chrome/renderer/geolocation_dispatcher.h" - -#include "chrome/renderer/render_view.h" -#include "ipc/ipc_message.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationPermissionRequest.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationPermissionRequestManager.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClient.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationPosition.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationError.h" -#include "third_party/WebKit/WebKit/chromium/public/WebSecurityOrigin.h" - -using namespace WebKit; - -GeolocationDispatcher::GeolocationDispatcher(RenderView* render_view) - : render_view_(render_view), - pending_permissions_(new WebGeolocationPermissionRequestManager()), - enable_high_accuracy_(false), - updating_(false) { -} - -GeolocationDispatcher::~GeolocationDispatcher() {} - -bool GeolocationDispatcher::OnMessageReceived(const IPC::Message& message) { - bool handled = true; - IPC_BEGIN_MESSAGE_MAP(GeolocationDispatcher, message) - IPC_MESSAGE_HANDLER(ViewMsg_Geolocation_PermissionSet, - OnGeolocationPermissionSet) - IPC_MESSAGE_HANDLER(ViewMsg_Geolocation_PositionUpdated, - OnGeolocationPositionUpdated) - IPC_MESSAGE_UNHANDLED(handled = false) - IPC_END_MESSAGE_MAP() - return handled; -} - -void GeolocationDispatcher::geolocationDestroyed() { - controller_.reset(); - DCHECK(!updating_); -} - -void GeolocationDispatcher::startUpdating() { - // TODO(jknotten): Remove url and bridge_id from StartUpdating message - // once we have switched over to client-based geolocation. - GURL url; - render_view_->Send(new ViewHostMsg_Geolocation_StartUpdating( - render_view_->routing_id(), -1, url, enable_high_accuracy_)); - updating_ = true; -} - -void GeolocationDispatcher::stopUpdating() { - // TODO(jknotten): Remove url and bridge_id from StopUpdating message - // once we have switched over to client-based geolocation. - render_view_->Send(new ViewHostMsg_Geolocation_StopUpdating( - render_view_->routing_id(), -1)); - updating_ = false; -} - -void GeolocationDispatcher::setEnableHighAccuracy(bool enable_high_accuracy) { - // GeolocationController calls setEnableHighAccuracy(true) before - // startUpdating in response to the first high-accuracy Geolocation - // subscription. When the last high-accuracy Geolocation unsubscribes - // it calls setEnableHighAccuracy(false) after stopUpdating. - bool has_changed = enable_high_accuracy_ != enable_high_accuracy; - enable_high_accuracy_ = enable_high_accuracy; - // We have a different accuracy requirement. Request browser to update. - if (updating_ && has_changed) - startUpdating(); -} - -void GeolocationDispatcher::setController( - WebGeolocationController* controller) { - controller_.reset(controller); -} - -bool GeolocationDispatcher::lastPosition(WebGeolocationPosition&) { - // The latest position is stored in the browser, not the renderer, so we - // would have to fetch it synchronously to give a good value here. The - // WebCore::GeolocationController already caches the last position it - // receives, so there is not much benefit to more position caching here. - return false; -} - -// TODO(jknotten): Change the messages to use a security origin, so no -// conversion is necessary. -void GeolocationDispatcher::requestPermission( - const WebGeolocationPermissionRequest& permissionRequest) { - int bridge_id = pending_permissions_->add(permissionRequest); - string16 origin = permissionRequest.securityOrigin().toString(); - render_view_->Send(new ViewHostMsg_Geolocation_RequestPermission( - render_view_->routing_id(), bridge_id, GURL(origin))); -} - -// TODO(jknotten): Change the messages to use a security origin, so no -// conversion is necessary. -void GeolocationDispatcher::cancelPermissionRequest( - const WebGeolocationPermissionRequest& permissionRequest) { - int bridge_id; - if (!pending_permissions_->remove(permissionRequest, bridge_id)) - return; - string16 origin = permissionRequest.securityOrigin().toString(); - render_view_->Send(new ViewHostMsg_Geolocation_CancelPermissionRequest( - render_view_->routing_id(), bridge_id, GURL(origin))); -} - -// Permission for using geolocation has been set. -void GeolocationDispatcher::OnGeolocationPermissionSet( - int bridge_id, bool is_allowed) { - WebGeolocationPermissionRequest permissionRequest; - if (!pending_permissions_->remove(bridge_id, permissionRequest)) - return; - permissionRequest.setIsAllowed(is_allowed); -} - -// We have an updated geolocation position or error code. -void GeolocationDispatcher::OnGeolocationPositionUpdated( - const Geoposition& geoposition) { - DCHECK(updating_); - DCHECK(geoposition.IsInitialized()); - if (geoposition.IsValidFix()) { - controller_->positionChanged( - WebGeolocationPosition( - static_cast<int64>(geoposition.timestamp.ToDoubleT() * 1000), - geoposition.latitude, geoposition.longitude, - geoposition.accuracy, - geoposition.is_valid_altitude(), geoposition.altitude, - geoposition.is_valid_altitude_accuracy(), - geoposition.altitude_accuracy, - geoposition.is_valid_heading(), geoposition.heading, - geoposition.is_valid_speed(), geoposition.speed)); - } else { - WebGeolocationError::Error code; - switch (geoposition.error_code) { - case Geoposition::ERROR_CODE_PERMISSION_DENIED: - code = WebGeolocationError::ErrorPermissionDenied; - break; - case Geoposition::ERROR_CODE_POSITION_UNAVAILABLE: - code = WebGeolocationError::ErrorPositionUnavailable; - break; - default: - DCHECK(false); - NOTREACHED() << geoposition.error_code; - return; - } - controller_->errorOccurred( - WebGeolocationError( - code, WebKit::WebString::fromUTF8(geoposition.error_message))); - } -} - -#endif // CLIENT_BASED_GEOLOCATION diff --git a/chrome/renderer/geolocation_dispatcher.h b/chrome/renderer/geolocation_dispatcher.h deleted file mode 100644 index 91c92a8..0000000 --- a/chrome/renderer/geolocation_dispatcher.h +++ /dev/null @@ -1,75 +0,0 @@ -// 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_H_ -#define CHROME_RENDERER_GEOLOCATION_DISPATCHER_H_ -#pragma once - -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - -#include "base/scoped_ptr.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClient.h" -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationController.h" - -class RenderView; -struct Geoposition; - -namespace WebKit { -class WebGeolocationController; -class WebGeolocationPermissionRequest; -class WebGeolocationPermissionRequestManager; -class WebGeolocationPosition; -class WebSecurityOrigin; -} - -namespace IPC { -class Message; -} - -// GeolocationDispatcher is a delegate for Geolocation messages used by -// WebKit. -// It's the complement of GeolocationDispatcherHost (owned by RenderViewHost). -class GeolocationDispatcher : public WebKit::WebGeolocationClient { - public: - explicit GeolocationDispatcher(RenderView* render_view); - virtual ~GeolocationDispatcher(); - - // IPC - bool OnMessageReceived(const IPC::Message& message); - - // WebGeolocationClient - virtual void geolocationDestroyed(); - virtual void startUpdating(); - virtual void stopUpdating(); - virtual void setEnableHighAccuracy(bool enable_high_accuracy); - virtual void setController(WebKit::WebGeolocationController* controller); - virtual bool lastPosition(WebKit::WebGeolocationPosition& position); - virtual void requestPermission( - const WebKit::WebGeolocationPermissionRequest& permissionRequest); - virtual void cancelPermissionRequest( - const WebKit::WebGeolocationPermissionRequest& permissionRequest); - - 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); - - // GeolocationDispatcher is owned by RenderView. Back pointer for IPC. - RenderView* render_view_; - - // The controller_ is valid for the lifetime of the underlying - // WebCore::GeolocationController. geolocationDestroyed() is - // invoked when the underlying object is destroyed. - scoped_ptr< WebKit::WebGeolocationController> controller_; - - scoped_ptr<WebKit::WebGeolocationPermissionRequestManager> - pending_permissions_; - bool enable_high_accuracy_; - bool updating_; -}; -#endif // ENABLE_CLIENT_BASED_GEOLOCATION - -#endif // CHROME_RENDERER_GEOLOCATION_DISPATCHER_H_ diff --git a/chrome/renderer/geolocation_dispatcher_old.cc b/chrome/renderer/geolocation_dispatcher_old.cc index 4a235c7..a6eff8b 100644 --- a/chrome/renderer/geolocation_dispatcher_old.cc +++ b/chrome/renderer/geolocation_dispatcher_old.cc @@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) #include "chrome/renderer/geolocation_dispatcher_old.h" + #include "base/command_line.h" #include "chrome/common/chrome_switches.h" #include "chrome/renderer/render_view.h" @@ -113,4 +113,3 @@ void GeolocationDispatcherOld::OnGeolocationPositionUpdated( } } } -#endif // !ENABLE_CLIENT_BASED_GEOLOCATION diff --git a/chrome/renderer/geolocation_dispatcher_old.h b/chrome/renderer/geolocation_dispatcher_old.h index 51567ef..57f7d8a 100644 --- a/chrome/renderer/geolocation_dispatcher_old.h +++ b/chrome/renderer/geolocation_dispatcher_old.h @@ -6,10 +6,6 @@ #define CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ #pragma once -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) -// TODO(jknotten): Remove this class once the new client-based implementation is -// checked in (see http://crbug.com/59908). - #include "base/basictypes.h" #include "base/id_map.h" #include "ipc/ipc_message.h" @@ -25,6 +21,8 @@ struct Geoposition; // 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); @@ -63,6 +61,4 @@ class GeolocationDispatcherOld : public WebKit::WebGeolocationService { DISALLOW_COPY_AND_ASSIGN(GeolocationDispatcherOld); }; -#endif // ENABLE_CLIENT_BASED_GEOLOCATION - #endif // CHROME_RENDERER_GEOLOCATION_DISPATCHER_OLD_H_ diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index ca0c0e5..b639dd0 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -63,11 +63,7 @@ #include "chrome/renderer/extensions/renderer_extension_bindings.h" #include "chrome/renderer/external_host_bindings.h" #include "chrome/renderer/external_popup_menu.h" -#if ENABLE_CLIENT_BASED_GEOLOCATION -#include "chrome/renderer/geolocation_dispatcher.h" -#else #include "chrome/renderer/geolocation_dispatcher_old.h" -#endif #include "chrome/renderer/ggl/ggl.h" #include "chrome/renderer/localized_error.h" #include "chrome/renderer/media/audio_renderer_impl.h" @@ -5623,20 +5619,11 @@ void RenderView::OnPageTranslated() { autofill_helper_->FrameContentsAvailable(frame); } -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -WebKit::WebGeolocationClient* RenderView::geolocationClient() -{ - if (!geolocation_dispatcher_.get()) - geolocation_dispatcher_.reset(new GeolocationDispatcher(this)); - return geolocation_dispatcher_.get(); -} -#else WebKit::WebGeolocationService* RenderView::geolocationService() { if (!geolocation_dispatcher_.get()) geolocation_dispatcher_.reset(new GeolocationDispatcherOld(this)); return geolocation_dispatcher_.get(); } -#endif WebKit::WebSpeechInputController* RenderView::speechInputController( WebKit::WebSpeechInputListener* listener) { diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index 8b0fb5b..cdd2102 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -64,7 +64,6 @@ class DomAutomationController; class DOMUIBindings; class ExternalHostBindings; class FilePath; -class GeolocationDispatcher; class GeolocationDispatcherOld; class GURL; class ListValue; @@ -121,7 +120,6 @@ class WebDataSource; class WebDocument; class WebDragData; class WebFrame; -class WebGeolocationClient; class WebGeolocationServiceInterface; class WebImage; class WebInputElement; @@ -484,11 +482,7 @@ class RenderView : public RenderWidget, virtual void didClearAutoFillSelection(const WebKit::WebNode& node); virtual void didAcceptAutocompleteSuggestion( const WebKit::WebInputElement& element); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - virtual WebKit::WebGeolocationClient* geolocationClient(); -#else virtual WebKit::WebGeolocationService* geolocationService(); -#endif virtual WebKit::WebSpeechInputController* speechInputController( WebKit::WebSpeechInputListener* listener); virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); @@ -1380,11 +1374,7 @@ class RenderView : public RenderWidget, scoped_refptr<AudioMessageFilter> audio_message_filter_; // The geolocation dispatcher attached to this view, lazily initialized. -#if ENABLE_CLIENT_BASED_GEOLOCATION - scoped_ptr<GeolocationDispatcher> geolocation_dispatcher_; -#else scoped_ptr<GeolocationDispatcherOld> geolocation_dispatcher_; -#endif // Handles accessibility requests into the renderer side, as well as // maintains the cache and other features of the accessibility tree. diff --git a/webkit/tools/test_shell/layout_test_controller.cc b/webkit/tools/test_shell/layout_test_controller.cc index 3ddfaab..16d7bcd 100644 --- a/webkit/tools/test_shell/layout_test_controller.cc +++ b/webkit/tools/test_shell/layout_test_controller.cc @@ -26,11 +26,7 @@ #include "third_party/WebKit/WebKit/chromium/public/WebDocument.h" #include "third_party/WebKit/WebKit/chromium/public/WebElement.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" -#else #include "third_party/WebKit/WebKit/chromium/public/WebGeolocationServiceMock.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/WebKit/chromium/public/WebScriptSource.h" #include "third_party/WebKit/WebKit/chromium/public/WebSecurityPolicy.h" @@ -56,16 +52,13 @@ using std::wstring; using WebKit::WebBindings; using WebKit::WebConsoleMessage; using WebKit::WebElement; +using WebKit::WebGeolocationServiceMock; using WebKit::WebScriptSource; using WebKit::WebSecurityPolicy; using WebKit::WebSize; using WebKit::WebString; using WebKit::WebURL; -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) -using WebKit::WebGeolocationServiceMock; -#endif - TestShell* LayoutTestController::shell_ = NULL; // Most of these flags need to be cleared in Reset() so that they get turned // off between each test run. @@ -1500,12 +1493,7 @@ void LayoutTestController::setGeolocationPermission(const CppArgumentList& args, CppVariant* result) { if (args.size() < 1 || !args[0].isBool()) return; -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - shell_->geolocation_client_mock()->setPermission( - args[0].ToBoolean()); -#else shell_->delegate()->SetGeolocationPermission(args[0].ToBoolean()); -#endif } void LayoutTestController::setMockGeolocationPosition( @@ -1513,26 +1501,16 @@ void LayoutTestController::setMockGeolocationPosition( if (args.size() < 3 || !args[0].isNumber() || !args[1].isNumber() || !args[2].isNumber()) return; -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - shell_->geolocation_client_mock()->setPosition( - args[0].ToDouble(), args[1].ToDouble(), args[2].ToDouble()); -#else WebGeolocationServiceMock::setMockGeolocationPosition( args[0].ToDouble(), args[1].ToDouble(), args[2].ToDouble()); -#endif } void LayoutTestController::setMockGeolocationError(const CppArgumentList& args, CppVariant* result) { if (args.size() < 2 || !args[0].isNumber() || !args[1].isString()) return; -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - shell_->geolocation_client_mock()->setError( - args[0].ToInt32(), WebString::fromUTF8(args[1].ToString())); -#else WebGeolocationServiceMock::setMockGeolocationError( args[0].ToInt32(), WebString::fromUTF8(args[1].ToString())); -#endif } void LayoutTestController::markerTextForListItem(const CppArgumentList& args, diff --git a/webkit/tools/test_shell/test_shell.cc b/webkit/tools/test_shell/test_shell.cc index 96d5415..fcd1773 100644 --- a/webkit/tools/test_shell/test_shell.cc +++ b/webkit/tools/test_shell/test_shell.cc @@ -34,9 +34,6 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" #include "third_party/WebKit/WebKit/chromium/public/WebDeviceOrientationClientMock.h" -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebSpeechInputControllerMock.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" @@ -652,10 +649,6 @@ void TestShell::ResetTestController() { event_sending_controller_->Reset(); notification_presenter_->Reset(); delegate_->Reset(); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - if (geolocation_client_mock_.get()) - geolocation_client_mock_->resetMock(); -#endif } void TestShell::LoadFile(const FilePath& file) { @@ -795,16 +788,6 @@ TestShell::speech_input_controller_mock() { return speech_input_controller_mock_.get(); } -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -WebKit::WebGeolocationClientMock* TestShell::geolocation_client_mock() { - if (!geolocation_client_mock_.get()) { - geolocation_client_mock_.reset( - WebKit::WebGeolocationClientMock::create()); - } - return geolocation_client_mock_.get(); -} -#endif - //----------------------------------------------------------------------------- namespace webkit_glue { diff --git a/webkit/tools/test_shell/test_shell.gypi b/webkit/tools/test_shell/test_shell.gypi index 088773f..d265a69 100644 --- a/webkit/tools/test_shell/test_shell.gypi +++ b/webkit/tools/test_shell/test_shell.gypi @@ -160,9 +160,6 @@ 'drop_delegate.cc', ], }], - ['"ENABLE_CLIENT_BASED_GEOLOCATION=1" in feature_defines', { - 'defines': [ 'ENABLE_CLIENT_BASED_GEOLOCATION=1' ] - }], ], }, { diff --git a/webkit/tools/test_shell/test_shell.h b/webkit/tools/test_shell/test_shell.h index 29d3d1f..56ade05 100644 --- a/webkit/tools/test_shell/test_shell.h +++ b/webkit/tools/test_shell/test_shell.h @@ -67,7 +67,6 @@ class StringPiece; namespace WebKit { class WebDeviceOrientationClientMock; -class WebGeolocationClientMock; class WebSpeechInputControllerMock; class WebSpeechInputListener; } @@ -373,10 +372,6 @@ public: WebKit::WebSpeechInputListener* listener); WebKit::WebSpeechInputControllerMock* speech_input_controller_mock(); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - WebKit::WebGeolocationClientMock* geolocation_client_mock(); -#endif - protected: void CreateDevToolsClient(TestShellDevToolsAgent* agent); bool Initialize(const GURL& starting_url); @@ -461,9 +456,6 @@ private: scoped_ptr<WebKit::WebSpeechInputControllerMock> speech_input_controller_mock_; -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - scoped_ptr<WebKit::WebGeolocationClientMock> geolocation_client_mock_; -#endif const TestParams* test_params_; // True while a test is preparing to run diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc index b791cf2..cd95bad 100644 --- a/webkit/tools/test_shell/test_webview_delegate.cc +++ b/webkit/tools/test_shell/test_webview_delegate.cc @@ -33,9 +33,6 @@ #include "third_party/WebKit/WebKit/chromium/public/WebFileError.h" #include "third_party/WebKit/WebKit/chromium/public/WebFileSystemCallbacks.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrame.h" -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -#include "third_party/WebKit/WebKit/chromium/public/WebGeolocationClientMock.h" -#endif #include "third_party/WebKit/WebKit/chromium/public/WebKit.h" #include "third_party/WebKit/WebKit/chromium/public/WebKitClient.h" #include "third_party/WebKit/WebKit/chromium/public/WebNode.h" @@ -657,15 +654,9 @@ WebNotificationPresenter* TestWebViewDelegate::notificationPresenter() { return shell_->notification_presenter(); } -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) -WebKit::WebGeolocationClient* TestWebViewDelegate::geolocationClient() { - return shell_->geolocation_client_mock(); -} -#else WebKit::WebGeolocationService* TestWebViewDelegate::geolocationService() { return GetTestGeolocationService(); } -#endif WebKit::WebDeviceOrientationClient* TestWebViewDelegate::deviceOrientationClient() { @@ -1216,11 +1207,9 @@ void TestWebViewDelegate::WaitForPolicyDelegate() { policy_delegate_should_notify_done_ = true; } -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) void TestWebViewDelegate::SetGeolocationPermission(bool allowed) { GetTestGeolocationService()->SetGeolocationPermission(allowed); } -#endif // Private methods ----------------------------------------------------------- @@ -1342,13 +1331,11 @@ std::wstring TestWebViewDelegate::GetFrameDescription(WebFrame* webframe) { } } -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) TestGeolocationService* TestWebViewDelegate::GetTestGeolocationService() { if (!test_geolocation_service_.get()) test_geolocation_service_.reset(new TestGeolocationService); return test_geolocation_service_.get(); } -#endif void TestWebViewDelegate::set_fake_window_rect(const WebRect& rect) { fake_rect_ = rect; diff --git a/webkit/tools/test_shell/test_webview_delegate.h b/webkit/tools/test_shell/test_webview_delegate.h index f5d81ad..3c7f38d 100644 --- a/webkit/tools/test_shell/test_webview_delegate.h +++ b/webkit/tools/test_shell/test_webview_delegate.h @@ -141,11 +141,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, virtual void focusAccessibilityObject( const WebKit::WebAccessibilityObject& object); virtual WebKit::WebNotificationPresenter* notificationPresenter(); -#if defined(ENABLE_CLIENT_BASED_GEOLOCATION) - WebKit::WebGeolocationClient* geolocationClient(); -#else virtual WebKit::WebGeolocationService* geolocationService(); -#endif virtual WebKit::WebDeviceOrientationClient* deviceOrientationClient(); virtual WebKit::WebSpeechInputController* speechInputController( WebKit::WebSpeechInputListener*); @@ -327,9 +323,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, edit_command_value_.clear(); } -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) void SetGeolocationPermission(bool allowed); -#endif void ClearContextMenuData(); @@ -385,10 +379,8 @@ class TestWebViewDelegate : public WebKit::WebViewClient, // Get a string suitable for dumping a frame to the console. std::wstring GetFrameDescription(WebKit::WebFrame* webframe); -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) // Returns a TestGeolocationService owned by this delegate. TestGeolocationService* GetTestGeolocationService(); -#endif // Causes navigation actions just printout the intended navigation instead // of taking you to the page. This is used for cases like mailto, where you @@ -467,9 +459,7 @@ class TestWebViewDelegate : public WebKit::WebViewClient, // The mock spellchecker used in TestWebViewDelegate::spellCheck(). MockSpellCheck mock_spellcheck_; -#if !defined(ENABLE_CLIENT_BASED_GEOLOCATION) scoped_ptr<TestGeolocationService> test_geolocation_service_; -#endif DISALLOW_COPY_AND_ASSIGN(TestWebViewDelegate); }; |