diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 19:59:38 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-29 19:59:38 +0000 |
commit | 543bddb3441e1c8c58ff067969c422bf834b78b9 (patch) | |
tree | 31fec7f764f2e70e556e493cae0d81afb1520e63 /ash/shell | |
parent | a4daa08472cef333323c8d466613bf5cff26deb6 (diff) | |
download | chromium_src-543bddb3441e1c8c58ff067969c422bf834b78b9.zip chromium_src-543bddb3441e1c8c58ff067969c422bf834b78b9.tar.gz chromium_src-543bddb3441e1c8c58ff067969c422bf834b78b9.tar.bz2 |
Give a default implementation for ContentBrowserClient so that there's less boilerplate for each embedder.
BUG=98716
Review URL: https://chromiumcodereview.appspot.com/10443059
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139350 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/shell')
-rw-r--r-- | ash/shell/content_client/shell_content_browser_client.cc | 325 | ||||
-rw-r--r-- | ash/shell/content_client/shell_content_browser_client.h | 163 |
2 files changed, 0 insertions, 488 deletions
diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc index 137e0a8..8d0be40 100644 --- a/ash/shell/content_client/shell_content_browser_client.cc +++ b/ash/shell/content_client/shell_content_browser_client.cc @@ -32,258 +32,11 @@ content::BrowserMainParts* ShellContentBrowserClient::CreateBrowserMainParts( return shell_browser_main_parts_; } -content::WebContentsView* - ShellContentBrowserClient::OverrideCreateWebContentsView( - content::WebContents* web_contents, - content::RenderViewHostDelegateView** render_view_host_delegate_view) { - return NULL; -} - -content::WebContentsViewDelegate* - ShellContentBrowserClient::GetWebContentsViewDelegate( - content::WebContents* web_contents) { - return NULL; -} - void ShellContentBrowserClient::RenderViewHostCreated( content::RenderViewHost* render_view_host) { new content::ShellRenderViewHostObserver(render_view_host); } -void ShellContentBrowserClient::RenderProcessHostCreated( - content::RenderProcessHost* host) { -} - -content::WebUIControllerFactory* - ShellContentBrowserClient::GetWebUIControllerFactory() { - return NULL; -} - -GURL ShellContentBrowserClient::GetEffectiveURL( - content::BrowserContext* browser_context, const GURL& url) { - return GURL(); -} - -bool ShellContentBrowserClient::ShouldUseProcessPerSite( - content::BrowserContext* browser_context, const GURL& effective_url) { - return false; -} - -bool ShellContentBrowserClient::IsHandledURL(const GURL& url) { - return false; -} - -bool ShellContentBrowserClient::IsSuitableHost( - content::RenderProcessHost* process_host, - const GURL& site_url) { - return true; -} - -bool ShellContentBrowserClient::ShouldTryToUseExistingProcessHost( - content::BrowserContext* browser_context, const GURL& url) { - return false; -} - -void ShellContentBrowserClient::SiteInstanceGotProcess( - content::SiteInstance* site_instance) { -} - -void ShellContentBrowserClient::SiteInstanceDeleting( - content::SiteInstance* site_instance) { -} - -bool ShellContentBrowserClient::ShouldSwapProcessesForNavigation( - const GURL& current_url, - const GURL& new_url) { - return false; -} - -bool ShellContentBrowserClient::ShouldSwapProcessesForRedirect( - content::ResourceContext* resource_context, const GURL& current_url, - const GURL& new_url) { - return false; -} - -std::string ShellContentBrowserClient::GetCanonicalEncodingNameByAliasName( - const std::string& alias_name) { - return std::string(); -} - -void ShellContentBrowserClient::AppendExtraCommandLineSwitches( - CommandLine* command_line, int child_process_id) { - if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) - command_line->AppendSwitch(switches::kDumpRenderTree); -} - -std::string ShellContentBrowserClient::GetApplicationLocale() { - return std::string(); -} - -std::string ShellContentBrowserClient::GetAcceptLangs( - content::BrowserContext* context) { - return std::string(); -} - -SkBitmap* ShellContentBrowserClient::GetDefaultFavicon() { - static SkBitmap empty; - return ∅ -} - -bool ShellContentBrowserClient::AllowAppCache( - const GURL& manifest_url, - const GURL& first_party, - content::ResourceContext* context) { - return true; -} - -bool ShellContentBrowserClient::AllowGetCookie( - const GURL& url, - const GURL& first_party, - const net::CookieList& cookie_list, - content::ResourceContext* context, - int render_process_id, - int render_view_id) { - return true; -} - -bool ShellContentBrowserClient::AllowSetCookie( - const GURL& url, - const GURL& first_party, - const std::string& cookie_line, - content::ResourceContext* context, - int render_process_id, - int render_view_id, - net::CookieOptions* options) { - return true; -} - -bool ShellContentBrowserClient::AllowSaveLocalState( - content::ResourceContext* context) { - return true; -} - -bool ShellContentBrowserClient::AllowWorkerDatabase( - const GURL& url, - const string16& name, - const string16& display_name, - unsigned long estimated_size, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) { - return true; -} - -bool ShellContentBrowserClient::AllowWorkerFileSystem( - const GURL& url, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) { - return true; -} - -bool ShellContentBrowserClient::AllowWorkerIndexedDB( - const GURL& url, - const string16& name, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) { - return true; -} - -content::QuotaPermissionContext* - ShellContentBrowserClient::CreateQuotaPermissionContext() { - return NULL; -} - -net::URLRequestContext* - ShellContentBrowserClient::OverrideRequestContextForURL( - const GURL& url, content::ResourceContext* context) { - return NULL; -} - -void ShellContentBrowserClient::OpenItem(const FilePath& path) { -} - -void ShellContentBrowserClient::ShowItemInFolder(const FilePath& path) { -} - -void ShellContentBrowserClient::AllowCertificateError( - int render_process_id, - int render_view_id, - int cert_error, - const net::SSLInfo& ssl_info, - const GURL& request_url, - bool overridable, - bool strict_enforcement, - const base::Callback<void(bool)>& callback, - bool* cancel_request) { -} - -void ShellContentBrowserClient::SelectClientCertificate( - int render_process_id, - int render_view_id, - const net::HttpNetworkSession* network_session, - net::SSLCertRequestInfo* cert_request_info, - const base::Callback<void(net::X509Certificate*)>& callback) { -} - -void ShellContentBrowserClient::AddNewCertificate( - net::URLRequest* request, - net::X509Certificate* cert, - int render_process_id, - int render_view_id) { -} - -void ShellContentBrowserClient::RequestMediaAccessPermission( - const content::MediaStreamRequest* request, - const content::MediaResponseCallback& callback) { -} - -content::MediaObserver* ShellContentBrowserClient::GetMediaObserver() { - return NULL; -} - -void ShellContentBrowserClient::RequestDesktopNotificationPermission( - const GURL& source_origin, - int callback_context, - int render_process_id, - int render_view_id) { -} - -WebKit::WebNotificationPresenter::Permission - ShellContentBrowserClient::CheckDesktopNotificationPermission( - const GURL& source_origin, - content::ResourceContext* context, - int render_process_id) { - return WebKit::WebNotificationPresenter::PermissionAllowed; -} - -void ShellContentBrowserClient::ShowDesktopNotification( - const content::ShowDesktopNotificationHostMsgParams& params, - int render_process_id, - int render_view_id, - bool worker) { -} - -void ShellContentBrowserClient::CancelDesktopNotification( - int render_process_id, - int render_view_id, - int notification_id) { -} - -bool ShellContentBrowserClient::CanCreateWindow( - const GURL& opener_url, - const GURL& origin, - WindowContainerType container_type, - content::ResourceContext* context, - int render_process_id, - bool* no_javascript_access) { - *no_javascript_access = false; - return true; -} - -std::string ShellContentBrowserClient::GetWorkerProcessTitle( - const GURL& url, content::ResourceContext* context) { - return std::string(); -} - void ShellContentBrowserClient::ResourceDispatcherHostCreated() { resource_dispatcher_host_delegate_.reset( new content::ShellResourceDispatcherHostDelegate); @@ -291,88 +44,10 @@ void ShellContentBrowserClient::ResourceDispatcherHostCreated() { resource_dispatcher_host_delegate_.get()); } -content::SpeechRecognitionManagerDelegate* - ShellContentBrowserClient::GetSpeechRecognitionManagerDelegate() { - return NULL; -} - ui::Clipboard* ShellContentBrowserClient::GetClipboard() { return shell_browser_main_parts_->GetClipboard(); } -net::NetLog* ShellContentBrowserClient::GetNetLog() { - return NULL; -} - -content::AccessTokenStore* - ShellContentBrowserClient::CreateAccessTokenStore() { - return NULL; -} - -bool ShellContentBrowserClient::IsFastShutdownPossible() { - return true; -} - -void ShellContentBrowserClient::OverrideWebkitPrefs( - content::RenderViewHost* rvh, - const GURL& url, - webkit_glue::WebPreferences* prefs) { -} - -void ShellContentBrowserClient::UpdateInspectorSetting( - content::RenderViewHost* rvh, - const std::string& key, - const std::string& value) { -} - -void ShellContentBrowserClient::ClearInspectorSettings( - content::RenderViewHost* rvh) { -} - -void ShellContentBrowserClient::BrowserURLHandlerCreated( - content::BrowserURLHandler* handler) { -} - -void ShellContentBrowserClient::ClearCache(content::RenderViewHost* rvh) { -} - -void ShellContentBrowserClient::ClearCookies(content::RenderViewHost* rvh) { -} - -FilePath ShellContentBrowserClient::GetDefaultDownloadDirectory() { - return FilePath(); -} - -std::string ShellContentBrowserClient::GetDefaultDownloadName() { - return "download"; -} - -bool ShellContentBrowserClient::AllowSocketAPI( - content::BrowserContext* browser_context, - const GURL& url) { - return false; -} - -#if defined(OS_POSIX) && !defined(OS_MACOSX) -int ShellContentBrowserClient::GetCrashSignalFD( - const CommandLine& command_line) { - return -1; -} -#endif - -#if defined(OS_WIN) -const wchar_t* ShellContentBrowserClient::GetResourceDllName() { - return NULL; -} -#endif - -#if defined(USE_NSS) -crypto::CryptoModuleBlockingPasswordDelegate* - ShellContentBrowserClient::GetCryptoPasswordDelegate(const GURL& url) { - return NULL; -} -#endif - content::ShellBrowserContext* ShellContentBrowserClient::browser_context() { return shell_browser_main_parts_->browser_context(); } diff --git a/ash/shell/content_client/shell_content_browser_client.h b/ash/shell/content_client/shell_content_browser_client.h index 9506738..bc4c85a 100644 --- a/ash/shell/content_client/shell_content_browser_client.h +++ b/ash/shell/content_client/shell_content_browser_client.h @@ -31,173 +31,10 @@ class ShellContentBrowserClient : public content::ContentBrowserClient { // Overridden from content::ContentBrowserClient: virtual content::BrowserMainParts* CreateBrowserMainParts( const content::MainFunctionParams& parameters) OVERRIDE; - virtual content::WebContentsView* OverrideCreateWebContentsView( - content::WebContents* web_contents, - content::RenderViewHostDelegateView** render_view_host_delegate_view) - OVERRIDE; - virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( - content::WebContents* web_contents) OVERRIDE; virtual void RenderViewHostCreated( content::RenderViewHost* render_view_host) OVERRIDE; - virtual void RenderProcessHostCreated( - content::RenderProcessHost* host) OVERRIDE; - virtual content::WebUIControllerFactory* GetWebUIControllerFactory() OVERRIDE; - virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, - const GURL& url) OVERRIDE; - virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, - const GURL& effective_url) OVERRIDE; - virtual bool IsHandledURL(const GURL& url) OVERRIDE; - virtual bool IsSuitableHost(content::RenderProcessHost* process_host, - const GURL& site_url) OVERRIDE; - virtual bool ShouldTryToUseExistingProcessHost( - content::BrowserContext* browser_context, const GURL& url) OVERRIDE; - virtual void SiteInstanceGotProcess( - content::SiteInstance* site_instance) OVERRIDE; - virtual void SiteInstanceDeleting( - content::SiteInstance* site_instance) OVERRIDE; - virtual bool ShouldSwapProcessesForNavigation(const GURL& current_url, - const GURL& new_url) OVERRIDE; - virtual bool ShouldSwapProcessesForRedirect( - content::ResourceContext* resource_context, - const GURL& current_url, - const GURL& new_url) OVERRIDE; - virtual std::string GetCanonicalEncodingNameByAliasName( - const std::string& alias_name) OVERRIDE; - virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, - int child_process_id) OVERRIDE; - virtual std::string GetApplicationLocale() OVERRIDE; - virtual std::string GetAcceptLangs( - content::BrowserContext* context) OVERRIDE; - virtual SkBitmap* GetDefaultFavicon() OVERRIDE; - virtual bool AllowAppCache(const GURL& manifest_url, - const GURL& first_party, - content::ResourceContext* context) OVERRIDE; - virtual bool AllowGetCookie(const GURL& url, - const GURL& first_party, - const net::CookieList& cookie_list, - content::ResourceContext* context, - int render_process_id, - int render_view_id) OVERRIDE; - virtual bool AllowSetCookie(const GURL& url, - const GURL& first_party, - const std::string& cookie_line, - content::ResourceContext* context, - int render_process_id, - int render_view_id, - net::CookieOptions* options) OVERRIDE; - virtual bool AllowSaveLocalState( - content::ResourceContext* context) OVERRIDE; - virtual bool AllowWorkerDatabase( - const GURL& url, - const string16& name, - const string16& display_name, - unsigned long estimated_size, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) OVERRIDE; - virtual bool AllowWorkerFileSystem( - const GURL& url, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) OVERRIDE; - virtual bool AllowWorkerIndexedDB( - const GURL& url, - const string16& name, - content::ResourceContext* context, - const std::vector<std::pair<int, int> >& render_views) OVERRIDE; - virtual net::URLRequestContext* OverrideRequestContextForURL( - const GURL& url, content::ResourceContext* context) OVERRIDE; - virtual content::QuotaPermissionContext* - CreateQuotaPermissionContext() OVERRIDE; - virtual void OpenItem(const FilePath& path) OVERRIDE; - virtual void ShowItemInFolder(const FilePath& path) OVERRIDE; - virtual void AllowCertificateError( - int render_process_id, - int render_view_id, - int cert_error, - const net::SSLInfo& ssl_info, - const GURL& request_url, - bool overridable, - bool strict_enforcement, - const base::Callback<void(bool)>& callback, - bool* cancel_request) OVERRIDE; - virtual void SelectClientCertificate( - int render_process_id, - int render_view_id, - const net::HttpNetworkSession* network_session, - net::SSLCertRequestInfo* cert_request_info, - const base::Callback<void(net::X509Certificate*)>& callback) OVERRIDE; - virtual void AddNewCertificate( - net::URLRequest* request, - net::X509Certificate* cert, - int render_process_id, - int render_view_id) OVERRIDE; - virtual void RequestMediaAccessPermission( - const content::MediaStreamRequest* request, - const content::MediaResponseCallback& callback) OVERRIDE; - virtual content::MediaObserver* GetMediaObserver() OVERRIDE; - virtual void RequestDesktopNotificationPermission( - const GURL& source_origin, - int callback_context, - int render_process_id, - int render_view_id) OVERRIDE; - virtual WebKit::WebNotificationPresenter::Permission - CheckDesktopNotificationPermission( - const GURL& origin, - content::ResourceContext* context, - int render_process_id) OVERRIDE; - virtual void ShowDesktopNotification( - const content::ShowDesktopNotificationHostMsgParams& params, - int render_process_id, - int render_view_id, - bool worker) OVERRIDE; - virtual void CancelDesktopNotification( - int render_process_id, - int render_view_id, - int notification_id) OVERRIDE; - virtual bool CanCreateWindow( - const GURL& opener_url, - const GURL& origin, - WindowContainerType container_type, - content::ResourceContext* context, - int render_process_id, - bool* no_javascript_access) OVERRIDE; - virtual std::string GetWorkerProcessTitle( - const GURL& url, content::ResourceContext* context) OVERRIDE; virtual void ResourceDispatcherHostCreated() OVERRIDE; - virtual content::SpeechRecognitionManagerDelegate* - GetSpeechRecognitionManagerDelegate() OVERRIDE; virtual ui::Clipboard* GetClipboard() OVERRIDE; - virtual net::NetLog* GetNetLog() OVERRIDE; - virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; - virtual bool IsFastShutdownPossible() OVERRIDE; - virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, - const GURL& url, - webkit_glue::WebPreferences* prefs) OVERRIDE; - virtual void UpdateInspectorSetting(content::RenderViewHost* rvh, - const std::string& key, - const std::string& value) OVERRIDE; - virtual void ClearInspectorSettings(content::RenderViewHost* rvh) OVERRIDE; - virtual void BrowserURLHandlerCreated( - content::BrowserURLHandler* handler) OVERRIDE; - virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE; - virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE; - virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; - virtual std::string GetDefaultDownloadName() OVERRIDE; - virtual bool AllowSocketAPI(content::BrowserContext* browser_context, - const GURL& url) OVERRIDE; - -#if defined(OS_POSIX) && !defined(OS_MACOSX) - virtual int GetCrashSignalFD(const CommandLine& command_line) OVERRIDE; -#endif - -#if defined(OS_WIN) - virtual const wchar_t* GetResourceDllName() OVERRIDE; -#endif - -#if defined(USE_NSS) - virtual - crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( - const GURL& url) OVERRIDE; -#endif content::ShellBrowserContext* browser_context(); |