OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef ASH_SHELL_CONTENT_CLIENT_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define ASH_SHELL_CONTENT_CLIENT_SHELL_CONTENT_BROWSER_CLIENT_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <string> |
| 10 |
| 11 #include "base/compiler_specific.h" |
| 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "content/public/browser/content_browser_client.h" |
| 14 |
| 15 namespace content { |
| 16 class ShellBrowserContext; |
| 17 class ShellBrowserMainParts; |
| 18 class ShellResourceDispatcherHostDelegate; |
| 19 } |
| 20 |
| 21 namespace ash { |
| 22 namespace shell { |
| 23 |
| 24 class ShellBrowserMainParts; |
| 25 |
| 26 class ShellContentBrowserClient : public content::ContentBrowserClient { |
| 27 public: |
| 28 ShellContentBrowserClient(); |
| 29 virtual ~ShellContentBrowserClient(); |
| 30 |
| 31 // Overridden from content::ContentBrowserClient: |
| 32 virtual content::BrowserMainParts* CreateBrowserMainParts( |
| 33 const content::MainFunctionParams& parameters) OVERRIDE; |
| 34 virtual content::WebContentsView* OverrideCreateWebContentsView( |
| 35 content::WebContents* web_contents) OVERRIDE; |
| 36 virtual content::WebContentsViewDelegate* GetWebContentsViewDelegate( |
| 37 content::WebContents* web_contents) OVERRIDE; |
| 38 virtual void RenderViewHostCreated( |
| 39 content::RenderViewHost* render_view_host) OVERRIDE; |
| 40 virtual void RenderProcessHostCreated( |
| 41 content::RenderProcessHost* host) OVERRIDE; |
| 42 virtual content::WebUIControllerFactory* GetWebUIControllerFactory() OVERRIDE; |
| 43 virtual GURL GetEffectiveURL(content::BrowserContext* browser_context, |
| 44 const GURL& url) OVERRIDE; |
| 45 virtual bool ShouldUseProcessPerSite(content::BrowserContext* browser_context, |
| 46 const GURL& effective_url) OVERRIDE; |
| 47 virtual bool IsHandledURL(const GURL& url) OVERRIDE; |
| 48 virtual bool IsSuitableHost(content::RenderProcessHost* process_host, |
| 49 const GURL& site_url) OVERRIDE; |
| 50 virtual bool ShouldTryToUseExistingProcessHost( |
| 51 content::BrowserContext* browser_context, const GURL& url) OVERRIDE; |
| 52 virtual void SiteInstanceGotProcess( |
| 53 content::SiteInstance* site_instance) OVERRIDE; |
| 54 virtual void SiteInstanceDeleting( |
| 55 content::SiteInstance* site_instance) OVERRIDE; |
| 56 virtual bool ShouldSwapProcessesForNavigation(const GURL& current_url, |
| 57 const GURL& new_url) OVERRIDE; |
| 58 |
| 59 virtual std::string GetCanonicalEncodingNameByAliasName( |
| 60 const std::string& alias_name) OVERRIDE; |
| 61 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, |
| 62 int child_process_id) OVERRIDE; |
| 63 virtual std::string GetApplicationLocale() OVERRIDE; |
| 64 virtual std::string GetAcceptLangs( |
| 65 content::BrowserContext* context) OVERRIDE; |
| 66 virtual SkBitmap* GetDefaultFavicon() OVERRIDE; |
| 67 virtual bool AllowAppCache(const GURL& manifest_url, |
| 68 const GURL& first_party, |
| 69 content::ResourceContext* context) OVERRIDE; |
| 70 virtual bool AllowGetCookie(const GURL& url, |
| 71 const GURL& first_party, |
| 72 const net::CookieList& cookie_list, |
| 73 content::ResourceContext* context, |
| 74 int render_process_id, |
| 75 int render_view_id) OVERRIDE; |
| 76 virtual bool AllowSetCookie(const GURL& url, |
| 77 const GURL& first_party, |
| 78 const std::string& cookie_line, |
| 79 content::ResourceContext* context, |
| 80 int render_process_id, |
| 81 int render_view_id, |
| 82 net::CookieOptions* options) OVERRIDE; |
| 83 virtual bool AllowSaveLocalState( |
| 84 content::ResourceContext* context) OVERRIDE; |
| 85 virtual bool AllowWorkerDatabase( |
| 86 const GURL& url, |
| 87 const string16& name, |
| 88 const string16& display_name, |
| 89 unsigned long estimated_size, |
| 90 content::ResourceContext* context, |
| 91 const std::vector<std::pair<int, int> >& render_views) OVERRIDE; |
| 92 virtual bool AllowWorkerFileSystem( |
| 93 const GURL& url, |
| 94 content::ResourceContext* context, |
| 95 const std::vector<std::pair<int, int> >& render_views) OVERRIDE; |
| 96 virtual bool AllowWorkerIndexedDB( |
| 97 const GURL& url, |
| 98 const string16& name, |
| 99 content::ResourceContext* context, |
| 100 const std::vector<std::pair<int, int> >& render_views) OVERRIDE; |
| 101 virtual net::URLRequestContext* OverrideRequestContextForURL( |
| 102 const GURL& url, content::ResourceContext* context) OVERRIDE; |
| 103 virtual content::QuotaPermissionContext* |
| 104 CreateQuotaPermissionContext() OVERRIDE; |
| 105 virtual void OpenItem(const FilePath& path) OVERRIDE; |
| 106 virtual void ShowItemInFolder(const FilePath& path) OVERRIDE; |
| 107 virtual void AllowCertificateError( |
| 108 int render_process_id, |
| 109 int render_view_id, |
| 110 int cert_error, |
| 111 const net::SSLInfo& ssl_info, |
| 112 const GURL& request_url, |
| 113 bool overridable, |
| 114 const base::Callback<void(bool)>& callback, |
| 115 bool* cancel_request) OVERRIDE; |
| 116 virtual void SelectClientCertificate( |
| 117 int render_process_id, |
| 118 int render_view_id, |
| 119 const net::HttpNetworkSession* network_session, |
| 120 net::SSLCertRequestInfo* cert_request_info, |
| 121 const base::Callback<void(net::X509Certificate*)>& callback) OVERRIDE; |
| 122 virtual void AddNewCertificate( |
| 123 net::URLRequest* request, |
| 124 net::X509Certificate* cert, |
| 125 int render_process_id, |
| 126 int render_view_id) OVERRIDE; |
| 127 virtual void RequestMediaAccessPermission( |
| 128 const content::MediaStreamRequest* request, |
| 129 const content::MediaResponseCallback& callback) OVERRIDE; |
| 130 virtual content::MediaObserver* GetMediaObserver() OVERRIDE; |
| 131 virtual void RequestDesktopNotificationPermission( |
| 132 const GURL& source_origin, |
| 133 int callback_context, |
| 134 int render_process_id, |
| 135 int render_view_id) OVERRIDE; |
| 136 virtual WebKit::WebNotificationPresenter::Permission |
| 137 CheckDesktopNotificationPermission( |
| 138 const GURL& origin, |
| 139 content::ResourceContext* context, |
| 140 int render_process_id) OVERRIDE; |
| 141 virtual void ShowDesktopNotification( |
| 142 const content::ShowDesktopNotificationHostMsgParams& params, |
| 143 int render_process_id, |
| 144 int render_view_id, |
| 145 bool worker) OVERRIDE; |
| 146 virtual void CancelDesktopNotification( |
| 147 int render_process_id, |
| 148 int render_view_id, |
| 149 int notification_id) OVERRIDE; |
| 150 virtual bool CanCreateWindow( |
| 151 const GURL& opener_url, |
| 152 const GURL& origin, |
| 153 WindowContainerType container_type, |
| 154 content::ResourceContext* context, |
| 155 int render_process_id, |
| 156 bool* no_javascript_access) OVERRIDE; |
| 157 virtual std::string GetWorkerProcessTitle( |
| 158 const GURL& url, content::ResourceContext* context) OVERRIDE; |
| 159 virtual void ResourceDispatcherHostCreated() OVERRIDE; |
| 160 virtual content::SpeechRecognitionManagerDelegate* |
| 161 GetSpeechRecognitionManagerDelegate() OVERRIDE; |
| 162 virtual ui::Clipboard* GetClipboard() OVERRIDE; |
| 163 virtual net::NetLog* GetNetLog() OVERRIDE; |
| 164 virtual content::AccessTokenStore* CreateAccessTokenStore() OVERRIDE; |
| 165 virtual bool IsFastShutdownPossible() OVERRIDE; |
| 166 virtual void OverrideWebkitPrefs(content::RenderViewHost* rvh, |
| 167 const GURL& url, |
| 168 WebPreferences* prefs) OVERRIDE; |
| 169 virtual void UpdateInspectorSetting(content::RenderViewHost* rvh, |
| 170 const std::string& key, |
| 171 const std::string& value) OVERRIDE; |
| 172 virtual void ClearInspectorSettings(content::RenderViewHost* rvh) OVERRIDE; |
| 173 virtual void BrowserURLHandlerCreated( |
| 174 content::BrowserURLHandler* handler) OVERRIDE; |
| 175 virtual void ClearCache(content::RenderViewHost* rvh) OVERRIDE; |
| 176 virtual void ClearCookies(content::RenderViewHost* rvh) OVERRIDE; |
| 177 virtual FilePath GetDefaultDownloadDirectory() OVERRIDE; |
| 178 virtual std::string GetDefaultDownloadName() OVERRIDE; |
| 179 virtual bool AllowSocketAPI(content::BrowserContext* browser_context, |
| 180 const GURL& url) OVERRIDE; |
| 181 |
| 182 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 183 virtual int GetCrashSignalFD(const CommandLine& command_line) OVERRIDE; |
| 184 #endif |
| 185 |
| 186 #if defined(OS_WIN) |
| 187 virtual const wchar_t* GetResourceDllName() OVERRIDE; |
| 188 #endif |
| 189 |
| 190 #if defined(USE_NSS) |
| 191 virtual |
| 192 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( |
| 193 const GURL& url) OVERRIDE; |
| 194 #endif |
| 195 |
| 196 content::ShellBrowserContext* browser_context(); |
| 197 |
| 198 private: |
| 199 scoped_ptr<content::ShellResourceDispatcherHostDelegate> |
| 200 resource_dispatcher_host_delegate_; |
| 201 |
| 202 ShellBrowserMainParts* shell_browser_main_parts_; |
| 203 |
| 204 DISALLOW_COPY_AND_ASSIGN(ShellContentBrowserClient); |
| 205 }; |
| 206 |
| 207 } // namespace shell |
| 208 } // namespace ash |
| 209 |
| 210 #endif // ASH_SHELL_CONTENT_CLIENT_SHELL_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |