diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 01:00:35 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-24 01:00:35 +0000 |
commit | 810ddc583119d037972380e6bdecd546fbac9504 (patch) | |
tree | f27c4941c4d220babbae358c75427646787aad20 /content | |
parent | ba4b4c2e9c36c60c9dbab427c10021fee0a6197c (diff) | |
download | chromium_src-810ddc583119d037972380e6bdecd546fbac9504.zip chromium_src-810ddc583119d037972380e6bdecd546fbac9504.tar.gz chromium_src-810ddc583119d037972380e6bdecd546fbac9504.tar.bz2 |
Hide geolocation_provider.h from chrome, and move geolocation_permission_context.h to content\public and into the content namespace.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/9160008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118767 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/geolocation/geolocation_dispatcher_host.cc | 22 | ||||
-rw-r--r-- | content/browser/geolocation/geolocation_dispatcher_host.h | 4 | ||||
-rw-r--r-- | content/content_browser.gypi | 2 | ||||
-rw-r--r-- | content/public/browser/browser_context.h | 2 | ||||
-rw-r--r-- | content/public/browser/geolocation_permission_context.h (renamed from content/browser/geolocation/geolocation_permission_context.h) | 4 | ||||
-rw-r--r-- | content/shell/shell_browser_context.cc | 6 | ||||
-rw-r--r-- | content/shell/shell_browser_context.h | 1 | ||||
-rw-r--r-- | content/test/test_browser_context.cc | 2 | ||||
-rw-r--r-- | content/test/test_browser_context.h | 4 |
9 files changed, 33 insertions, 14 deletions
diff --git a/content/browser/geolocation/geolocation_dispatcher_host.cc b/content/browser/geolocation/geolocation_dispatcher_host.cc index 51f475e..78b7392 100644 --- a/content/browser/geolocation/geolocation_dispatcher_host.cc +++ b/content/browser/geolocation/geolocation_dispatcher_host.cc @@ -9,24 +9,38 @@ #include <utility> #include "base/bind.h" -#include "content/browser/geolocation/geolocation_permission_context.h" #include "content/browser/geolocation/geolocation_provider.h" #include "content/browser/renderer_host/render_message_filter.h" #include "content/browser/renderer_host/render_process_host_impl.h" #include "content/browser/renderer_host/render_view_host.h" +#include "content/public/browser/geolocation_permission_context.h" #include "content/common/geolocation_messages.h" #include "content/common/geoposition.h" using content::BrowserThread; +using content::GeolocationPermissionContext; namespace { +void NotifyArbitratorPermissionGranted( + const GURL& requesting_frame) { + DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); + GeolocationProvider::GetInstance()->OnPermissionGranted(requesting_frame); +} + void SendGeolocationPermissionResponse( - int render_process_id, int render_view_id, int bridge_id, bool allowed) { + const GURL& requesting_frame, int render_process_id, int render_view_id, + int bridge_id, bool allowed) { RenderViewHost* r = RenderViewHost::FromID(render_process_id, render_view_id); if (!r) return; r->Send(new GeolocationMsg_PermissionSet(render_view_id, bridge_id, allowed)); + + if (allowed) { + BrowserThread::PostTask( + BrowserThread::IO, FROM_HERE, + base::Bind(&NotifyArbitratorPermissionGranted, requesting_frame)); + } } class GeolocationDispatcherHostImpl : public GeolocationDispatcherHost, @@ -128,8 +142,8 @@ void GeolocationDispatcherHostImpl::OnRequestPermission( render_process_id_, render_view_id, bridge_id, requesting_frame, base::Bind( - &SendGeolocationPermissionResponse, render_process_id_, - render_view_id, bridge_id)); + &SendGeolocationPermissionResponse, requesting_frame, + render_process_id_, render_view_id, bridge_id)); } void GeolocationDispatcherHostImpl::OnCancelPermissionRequest( diff --git a/content/browser/geolocation/geolocation_dispatcher_host.h b/content/browser/geolocation/geolocation_dispatcher_host.h index acd46d6..bdf6a17 100644 --- a/content/browser/geolocation/geolocation_dispatcher_host.h +++ b/content/browser/geolocation/geolocation_dispatcher_host.h @@ -8,7 +8,9 @@ #include "content/public/browser/browser_message_filter.h" +namespace content { class GeolocationPermissionContext; +} // GeolocationDispatcherHost is a browser filter for Geolocation messages. // It's the complement of GeolocationDispatcher (owned by RenderView). @@ -16,7 +18,7 @@ class GeolocationDispatcherHost : public content::BrowserMessageFilter { public: static GeolocationDispatcherHost* New( int render_process_id, - GeolocationPermissionContext* geolocation_permission_context); + content::GeolocationPermissionContext* geolocation_permission_context); protected: GeolocationDispatcherHost() {} diff --git a/content/content_browser.gypi b/content/content_browser.gypi index e520eb3..ce38ebc 100644 --- a/content/content_browser.gypi +++ b/content/content_browser.gypi @@ -54,6 +54,7 @@ 'public/browser/download_manager_delegate.h', 'public/browser/favicon_status.cc', 'public/browser/favicon_status.h', + 'public/browser/geolocation_permission_context.h', 'public/browser/global_request_id.h', 'public/browser/invalidate_type.h', 'public/browser/native_web_keyboard_event.h', @@ -273,7 +274,6 @@ 'browser/geolocation/geolocation_dispatcher_host.cc', 'browser/geolocation/geolocation_dispatcher_host.h', 'browser/geolocation/geolocation_observer.h', - 'browser/geolocation/geolocation_permission_context.h', 'browser/geolocation/geolocation_provider.cc', 'browser/geolocation/geolocation_provider.h', 'browser/geolocation/gps_location_provider_linux.cc', diff --git a/content/public/browser/browser_context.h b/content/public/browser/browser_context.h index 10e7363..7a4d95a 100644 --- a/content/public/browser/browser_context.h +++ b/content/public/browser/browser_context.h @@ -27,7 +27,6 @@ class DatabaseTracker; class ChromeAppCacheService; class ChromeBlobStorageContext; class FilePath; -class GeolocationPermissionContext; class SpeechInputPreferences; class HostZoomMap; class SSLHostState; @@ -36,6 +35,7 @@ class WebKitContext; namespace content { class DownloadManager; +class GeolocationPermissionContext; class ResourceContext; // This class holds the context needed for a browsing session. diff --git a/content/browser/geolocation/geolocation_permission_context.h b/content/public/browser/geolocation_permission_context.h index 848c964..9e2eef2 100644 --- a/content/browser/geolocation/geolocation_permission_context.h +++ b/content/public/browser/geolocation_permission_context.h @@ -12,6 +12,8 @@ class GURL; +namespace content { + // GeolocationPermissionContext must be implemented by the embedder, to provide // the policy and logic for the Geolocation permissions flow. // This includes both prompting the user and persisting results, as required. @@ -40,4 +42,6 @@ class CONTENT_EXPORT GeolocationPermissionContext friend class base::RefCountedThreadSafe<GeolocationPermissionContext>; }; +} // namespace content + #endif // CONTENT_BROWSER_GEOLOCATION_GEOLOCATION_PERMISSION_CONTEXT_H_ diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index f8d4961..2590ee8 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -16,12 +16,12 @@ #include "content/browser/download/download_manager_impl.h" #include "content/browser/download/download_status_updater.h" #include "content/browser/file_system/browser_file_system_helper.h" -#include "content/browser/geolocation/geolocation_permission_context.h" #include "content/browser/host_zoom_map.h" #include "content/browser/in_process_webkit/webkit_context.h" #include "content/browser/speech/speech_input_preferences.h" #include "content/browser/ssl/ssl_host_state.h" #include "content/public/browser/browser_thread.h" +#include "content/public/browser/geolocation_permission_context.h" #include "content/shell/shell_browser_main.h" #include "content/shell/shell_download_manager_delegate.h" #include "content/shell/shell_resource_context.h" @@ -37,6 +37,8 @@ using content::BrowserThread; +namespace content { + namespace { #if defined(OS_LINUX) @@ -90,8 +92,6 @@ class ShellSpeechInputPreferences : public SpeechInputPreferences { } // namespace -namespace content { - ShellBrowserContext::ShellBrowserContext( ShellBrowserMainParts* shell_main_parts) : download_id_factory_(new DownloadIdFactory(this)), diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h index dafba7b..5bf24b8 100644 --- a/content/shell/shell_browser_context.h +++ b/content/shell/shell_browser_context.h @@ -15,7 +15,6 @@ class DownloadIdFactory; class DownloadManager; class DownloadStatusUpdater; -class GeolocationPermissionContext; class HostZoomMap; class SSLHostState; diff --git a/content/test/test_browser_context.cc b/content/test/test_browser_context.cc index 9c17d9b..4461eb8 100644 --- a/content/test/test_browser_context.cc +++ b/content/test/test_browser_context.cc @@ -56,7 +56,7 @@ HostZoomMap* TestBrowserContext::GetHostZoomMap() { return NULL; } -GeolocationPermissionContext* +content::GeolocationPermissionContext* TestBrowserContext::GetGeolocationPermissionContext() { return NULL; } diff --git a/content/test/test_browser_context.h b/content/test/test_browser_context.h index a784ba4..3824d49 100644 --- a/content/test/test_browser_context.h +++ b/content/test/test_browser_context.h @@ -30,8 +30,8 @@ class TestBrowserContext : public content::BrowserContext { virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; virtual const content::ResourceContext& GetResourceContext() OVERRIDE; virtual HostZoomMap* GetHostZoomMap() OVERRIDE; - virtual GeolocationPermissionContext* GetGeolocationPermissionContext() - OVERRIDE; + virtual content::GeolocationPermissionContext* + GetGeolocationPermissionContext() OVERRIDE; virtual SpeechInputPreferences* GetSpeechInputPreferences() OVERRIDE; virtual bool DidLastSessionExitCleanly() OVERRIDE; virtual quota::QuotaManager* GetQuotaManager() OVERRIDE; |