| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 class ResourceContext; | 73 class ResourceContext; |
| 74 class SiteInstance; | 74 class SiteInstance; |
| 75 class SpeechInputManagerDelegate; | 75 class SpeechInputManagerDelegate; |
| 76 class WebContents; | 76 class WebContents; |
| 77 class WebContentsView; | 77 class WebContentsView; |
| 78 class WebContentsViewDelegate; | 78 class WebContentsViewDelegate; |
| 79 class WebUIControllerFactory; | 79 class WebUIControllerFactory; |
| 80 struct MainFunctionParams; | 80 struct MainFunctionParams; |
| 81 struct ShowDesktopNotificationHostMsgParams; | 81 struct ShowDesktopNotificationHostMsgParams; |
| 82 | 82 |
| 83 typedef base::Callback< void(const content::MediaStreamDevices&) > | 83 typedef base::Callback< void(const MediaStreamDevices&) > MediaResponseCallback; |
| 84 MediaResponseCallback; | |
| 85 | 84 |
| 86 // Embedder API (or SPI) for participating in browser logic, to be implemented | 85 // Embedder API (or SPI) for participating in browser logic, to be implemented |
| 87 // by the client of the content browser. See ChromeContentBrowserClient for the | 86 // by the client of the content browser. See ChromeContentBrowserClient for the |
| 88 // principal implementation. The methods are assumed to be called on the UI | 87 // principal implementation. The methods are assumed to be called on the UI |
| 89 // thread unless otherwise specified. Use this "escape hatch" sparingly, to | 88 // thread unless otherwise specified. Use this "escape hatch" sparingly, to |
| 90 // avoid the embedder interface ballooning and becoming very specific to Chrome. | 89 // avoid the embedder interface ballooning and becoming very specific to Chrome. |
| 91 // (Often, the call out to the client can happen in a different part of the code | 90 // (Often, the call out to the client can happen in a different part of the code |
| 92 // that either already has a hook out to the embedder, or calls out to one of | 91 // that either already has a hook out to the embedder, or calls out to one of |
| 93 // the observer interfaces.) | 92 // the observer interfaces.) |
| 94 class ContentBrowserClient { | 93 class ContentBrowserClient { |
| 95 public: | 94 public: |
| 96 virtual ~ContentBrowserClient() {} | 95 virtual ~ContentBrowserClient() {} |
| 97 | 96 |
| 98 // Allows the embedder to set any number of custom BrowserMainParts | 97 // Allows the embedder to set any number of custom BrowserMainParts |
| 99 // implementations for the browser startup code. See comments in | 98 // implementations for the browser startup code. See comments in |
| 100 // browser_main_parts.h. | 99 // browser_main_parts.h. |
| 101 virtual BrowserMainParts* CreateBrowserMainParts( | 100 virtual BrowserMainParts* CreateBrowserMainParts( |
| 102 const content::MainFunctionParams& parameters) = 0; | 101 const MainFunctionParams& parameters) = 0; |
| 103 | 102 |
| 104 // Allows an embedder to return their own WebContentsView implementation. | 103 // Allows an embedder to return their own WebContentsView implementation. |
| 105 // Return NULL to let the default one for the platform be created. | 104 // Return NULL to let the default one for the platform be created. |
| 106 virtual WebContentsView* OverrideCreateWebContentsView( | 105 virtual WebContentsView* OverrideCreateWebContentsView( |
| 107 WebContents* web_contents) = 0; | 106 WebContents* web_contents) = 0; |
| 108 | 107 |
| 109 // If content creates the WebContentsView implementation, it will ask the | 108 // If content creates the WebContentsView implementation, it will ask the |
| 110 // embedder to return an (optional) delegate to customize it. The view will | 109 // embedder to return an (optional) delegate to customize it. The view will |
| 111 // own the delegate. | 110 // own the delegate. |
| 112 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( | 111 virtual WebContentsViewDelegate* GetWebContentsViewDelegate( |
| 113 WebContents* web_contents) = 0; | 112 WebContents* web_contents) = 0; |
| 114 | 113 |
| 115 // Notifies that a new RenderHostView has been created. | 114 // Notifies that a new RenderHostView has been created. |
| 116 virtual void RenderViewHostCreated( | 115 virtual void RenderViewHostCreated(RenderViewHost* render_view_host) = 0; |
| 117 content::RenderViewHost* render_view_host) = 0; | |
| 118 | 116 |
| 119 // Notifies that a RenderProcessHost has been created. This is called before | 117 // Notifies that a RenderProcessHost has been created. This is called before |
| 120 // the content layer adds its own BrowserMessageFilters, so that the | 118 // the content layer adds its own BrowserMessageFilters, so that the |
| 121 // embedder's IPC filters have priority. | 119 // embedder's IPC filters have priority. |
| 122 virtual void RenderProcessHostCreated( | 120 virtual void RenderProcessHostCreated(RenderProcessHost* host) = 0; |
| 123 content::RenderProcessHost* host) = 0; | |
| 124 | 121 |
| 125 // Notifies that a BrowserChildProcessHost has been created. | 122 // Notifies that a BrowserChildProcessHost has been created. |
| 126 virtual void BrowserChildProcessHostCreated( | 123 virtual void BrowserChildProcessHostCreated(BrowserChildProcessHost* host) {} |
| 127 content::BrowserChildProcessHost* host) {} | |
| 128 | 124 |
| 129 // Gets the WebUIControllerFactory which will be responsible for generating | 125 // Gets the WebUIControllerFactory which will be responsible for generating |
| 130 // WebUIs. Can return NULL if the embedder doesn't need WebUI support. | 126 // WebUIs. Can return NULL if the embedder doesn't need WebUI support. |
| 131 virtual WebUIControllerFactory* GetWebUIControllerFactory() = 0; | 127 virtual WebUIControllerFactory* GetWebUIControllerFactory() = 0; |
| 132 | 128 |
| 133 // Get the effective URL for the given actual URL, to allow an embedder to | 129 // Get the effective URL for the given actual URL, to allow an embedder to |
| 134 // group different url schemes in the same SiteInstance. | 130 // group different url schemes in the same SiteInstance. |
| 135 virtual GURL GetEffectiveURL(BrowserContext* browser_context, | 131 virtual GURL GetEffectiveURL(BrowserContext* browser_context, |
| 136 const GURL& url) = 0; | 132 const GURL& url) = 0; |
| 137 | 133 |
| 138 // Returns whether all instances of the specified effective URL should be | 134 // Returns whether all instances of the specified effective URL should be |
| 139 // rendered by the same process, rather than using process-per-site-instance. | 135 // rendered by the same process, rather than using process-per-site-instance. |
| 140 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, | 136 virtual bool ShouldUseProcessPerSite(BrowserContext* browser_context, |
| 141 const GURL& effective_url) = 0; | 137 const GURL& effective_url) = 0; |
| 142 | 138 |
| 143 // Returns whether a specified URL is handled by the embedder's internal | 139 // Returns whether a specified URL is handled by the embedder's internal |
| 144 // protocol handlers. | 140 // protocol handlers. |
| 145 virtual bool IsHandledURL(const GURL& url) = 0; | 141 virtual bool IsHandledURL(const GURL& url) = 0; |
| 146 | 142 |
| 147 // Returns whether a new view for a given |site_url| can be launched in a | 143 // Returns whether a new view for a given |site_url| can be launched in a |
| 148 // given |process_host|. | 144 // given |process_host|. |
| 149 virtual bool IsSuitableHost(content::RenderProcessHost* process_host, | 145 virtual bool IsSuitableHost(RenderProcessHost* process_host, |
| 150 const GURL& site_url) = 0; | 146 const GURL& site_url) = 0; |
| 151 | 147 |
| 152 // Returns whether a new process should be created or an existing one should | 148 // Returns whether a new process should be created or an existing one should |
| 153 // be reused based on the URL we want to load. This should return false, | 149 // be reused based on the URL we want to load. This should return false, |
| 154 // unless there is a good reason otherwise. | 150 // unless there is a good reason otherwise. |
| 155 virtual bool ShouldTryToUseExistingProcessHost( | 151 virtual bool ShouldTryToUseExistingProcessHost( |
| 156 BrowserContext* browser_context, const GURL& url) = 0; | 152 BrowserContext* browser_context, const GURL& url) = 0; |
| 157 | 153 |
| 158 // Called when a site instance is first associated with a process. | 154 // Called when a site instance is first associated with a process. |
| 159 virtual void SiteInstanceGotProcess( | 155 virtual void SiteInstanceGotProcess(SiteInstance* site_instance) = 0; |
| 160 content::SiteInstance* site_instance) = 0; | |
| 161 | 156 |
| 162 // Called from a site instance's destructor. | 157 // Called from a site instance's destructor. |
| 163 virtual void SiteInstanceDeleting(content::SiteInstance* site_instance) = 0; | 158 virtual void SiteInstanceDeleting(SiteInstance* site_instance) = 0; |
| 164 | 159 |
| 165 // Returns true if for the navigation from |current_url| to |new_url|, | 160 // Returns true if for the navigation from |current_url| to |new_url|, |
| 166 // processes should be swapped (even if we are in a process model that | 161 // processes should be swapped (even if we are in a process model that |
| 167 // doesn't usually swap). | 162 // doesn't usually swap). |
| 168 virtual bool ShouldSwapProcessesForNavigation(const GURL& current_url, | 163 virtual bool ShouldSwapProcessesForNavigation(const GURL& current_url, |
| 169 const GURL& new_url) = 0; | 164 const GURL& new_url) = 0; |
| 170 | 165 |
| 166 // Returns true if the given navigation redirect should cause a renderer |
| 167 // process swap. |
| 168 // This is called on the IO thread. |
| 169 virtual bool ShouldSwapProcessesForRedirect(ResourceContext* resource_context, |
| 170 const GURL& current_url, |
| 171 const GURL& new_url) = 0; |
| 172 |
| 171 // See CharacterEncoding's comment. | 173 // See CharacterEncoding's comment. |
| 172 virtual std::string GetCanonicalEncodingNameByAliasName( | 174 virtual std::string GetCanonicalEncodingNameByAliasName( |
| 173 const std::string& alias_name) = 0; | 175 const std::string& alias_name) = 0; |
| 174 | 176 |
| 175 // Allows the embedder to pass extra command line flags. | 177 // Allows the embedder to pass extra command line flags. |
| 176 // switches::kProcessType will already be set at this point. | 178 // switches::kProcessType will already be set at this point. |
| 177 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, | 179 virtual void AppendExtraCommandLineSwitches(CommandLine* command_line, |
| 178 int child_process_id) = 0; | 180 int child_process_id) = 0; |
| 179 | 181 |
| 180 // Returns the locale used by the application. | 182 // Returns the locale used by the application. |
| 181 virtual std::string GetApplicationLocale() = 0; | 183 virtual std::string GetApplicationLocale() = 0; |
| 182 | 184 |
| 183 // Returns the languages used in the Accept-Languages HTTP header. | 185 // Returns the languages used in the Accept-Languages HTTP header. |
| 184 // (Not called GetAcceptLanguages so it doesn't clash with win32). | 186 // (Not called GetAcceptLanguages so it doesn't clash with win32). |
| 185 virtual std::string GetAcceptLangs( | 187 virtual std::string GetAcceptLangs(BrowserContext* context) = 0; |
| 186 content::BrowserContext* context) = 0; | |
| 187 | 188 |
| 188 // Returns the default favicon. The callee doesn't own the given bitmap. | 189 // Returns the default favicon. The callee doesn't own the given bitmap. |
| 189 virtual SkBitmap* GetDefaultFavicon() = 0; | 190 virtual SkBitmap* GetDefaultFavicon() = 0; |
| 190 | 191 |
| 191 // Allow the embedder to control if an AppCache can be used for the given url. | 192 // Allow the embedder to control if an AppCache can be used for the given url. |
| 192 // This is called on the IO thread. | 193 // This is called on the IO thread. |
| 193 virtual bool AllowAppCache(const GURL& manifest_url, | 194 virtual bool AllowAppCache(const GURL& manifest_url, |
| 194 const GURL& first_party, | 195 const GURL& first_party, |
| 195 content::ResourceContext* context) = 0; | 196 ResourceContext* context) = 0; |
| 196 | 197 |
| 197 // Allow the embedder to control if the given cookie can be read. | 198 // Allow the embedder to control if the given cookie can be read. |
| 198 // This is called on the IO thread. | 199 // This is called on the IO thread. |
| 199 virtual bool AllowGetCookie(const GURL& url, | 200 virtual bool AllowGetCookie(const GURL& url, |
| 200 const GURL& first_party, | 201 const GURL& first_party, |
| 201 const net::CookieList& cookie_list, | 202 const net::CookieList& cookie_list, |
| 202 content::ResourceContext* context, | 203 ResourceContext* context, |
| 203 int render_process_id, | 204 int render_process_id, |
| 204 int render_view_id) = 0; | 205 int render_view_id) = 0; |
| 205 | 206 |
| 206 // Allow the embedder to control if the given cookie can be set. | 207 // Allow the embedder to control if the given cookie can be set. |
| 207 // This is called on the IO thread. | 208 // This is called on the IO thread. |
| 208 virtual bool AllowSetCookie(const GURL& url, | 209 virtual bool AllowSetCookie(const GURL& url, |
| 209 const GURL& first_party, | 210 const GURL& first_party, |
| 210 const std::string& cookie_line, | 211 const std::string& cookie_line, |
| 211 content::ResourceContext* context, | 212 ResourceContext* context, |
| 212 int render_process_id, | 213 int render_process_id, |
| 213 int render_view_id, | 214 int render_view_id, |
| 214 net::CookieOptions* options) = 0; | 215 net::CookieOptions* options) = 0; |
| 215 | 216 |
| 216 // This is called on the IO thread. | 217 // This is called on the IO thread. |
| 217 virtual bool AllowSaveLocalState(content::ResourceContext* context) = 0; | 218 virtual bool AllowSaveLocalState(ResourceContext* context) = 0; |
| 218 | 219 |
| 219 // Allow the embedder to control if access to web database by a shared worker | 220 // Allow the embedder to control if access to web database by a shared worker |
| 220 // is allowed. |render_views| is a vector of pairs of | 221 // is allowed. |render_views| is a vector of pairs of |
| 221 // RenderProcessID/RenderViewID of RenderViews that are using this worker. | 222 // RenderProcessID/RenderViewID of RenderViews that are using this worker. |
| 222 // This is called on the IO thread. | 223 // This is called on the IO thread. |
| 223 virtual bool AllowWorkerDatabase( | 224 virtual bool AllowWorkerDatabase( |
| 224 const GURL& url, | 225 const GURL& url, |
| 225 const string16& name, | 226 const string16& name, |
| 226 const string16& display_name, | 227 const string16& display_name, |
| 227 unsigned long estimated_size, | 228 unsigned long estimated_size, |
| 228 content::ResourceContext* context, | 229 ResourceContext* context, |
| 229 const std::vector<std::pair<int, int> >& render_views) = 0; | 230 const std::vector<std::pair<int, int> >& render_views) = 0; |
| 230 | 231 |
| 231 // Allow the embedder to control if access to file system by a shared worker | 232 // Allow the embedder to control if access to file system by a shared worker |
| 232 // is allowed. | 233 // is allowed. |
| 233 // This is called on the IO thread. | 234 // This is called on the IO thread. |
| 234 virtual bool AllowWorkerFileSystem( | 235 virtual bool AllowWorkerFileSystem( |
| 235 const GURL& url, | 236 const GURL& url, |
| 236 content::ResourceContext* context, | 237 ResourceContext* context, |
| 237 const std::vector<std::pair<int, int> >& render_views) = 0; | 238 const std::vector<std::pair<int, int> >& render_views) = 0; |
| 238 | 239 |
| 239 // Allow the embedder to control if access to IndexedDB by a shared worker | 240 // Allow the embedder to control if access to IndexedDB by a shared worker |
| 240 // is allowed. | 241 // is allowed. |
| 241 // This is called on the IO thread. | 242 // This is called on the IO thread. |
| 242 virtual bool AllowWorkerIndexedDB( | 243 virtual bool AllowWorkerIndexedDB( |
| 243 const GURL& url, | 244 const GURL& url, |
| 244 const string16& name, | 245 const string16& name, |
| 245 content::ResourceContext* context, | 246 ResourceContext* context, |
| 246 const std::vector<std::pair<int, int> >& render_views) = 0; | 247 const std::vector<std::pair<int, int> >& render_views) = 0; |
| 247 | 248 |
| 248 // Allows the embedder to override the request context based on the URL for | 249 // Allows the embedder to override the request context based on the URL for |
| 249 // certain operations, like cookie access. Returns NULL to indicate the | 250 // certain operations, like cookie access. Returns NULL to indicate the |
| 250 // regular request context should be used. | 251 // regular request context should be used. |
| 251 // This is called on the IO thread. | 252 // This is called on the IO thread. |
| 252 virtual net::URLRequestContext* OverrideRequestContextForURL( | 253 virtual net::URLRequestContext* OverrideRequestContextForURL( |
| 253 const GURL& url, content::ResourceContext* context) = 0; | 254 const GURL& url, ResourceContext* context) = 0; |
| 254 | 255 |
| 255 // Create and return a new quota permission context. | 256 // Create and return a new quota permission context. |
| 256 virtual QuotaPermissionContext* CreateQuotaPermissionContext() = 0; | 257 virtual QuotaPermissionContext* CreateQuotaPermissionContext() = 0; |
| 257 | 258 |
| 258 // Open the given file in the desktop's default manner. | 259 // Open the given file in the desktop's default manner. |
| 259 virtual void OpenItem(const FilePath& path) = 0; | 260 virtual void OpenItem(const FilePath& path) = 0; |
| 260 | 261 |
| 261 // Show the given file in a file manager. If possible, select the file. | 262 // Show the given file in a file manager. If possible, select the file. |
| 262 virtual void ShowItemInFolder(const FilePath& path) = 0; | 263 virtual void ShowItemInFolder(const FilePath& path) = 0; |
| 263 | 264 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 299 // Returns a a class to get notifications about media event. The embedder can | 300 // Returns a a class to get notifications about media event. The embedder can |
| 300 // return NULL if they're not interested. | 301 // return NULL if they're not interested. |
| 301 virtual MediaObserver* GetMediaObserver() = 0; | 302 virtual MediaObserver* GetMediaObserver() = 0; |
| 302 | 303 |
| 303 // Asks permission to use the camera and/or microphone. If permission is | 304 // Asks permission to use the camera and/or microphone. If permission is |
| 304 // granted, a call should be made to |callback| with the devices. If the | 305 // granted, a call should be made to |callback| with the devices. If the |
| 305 // request is denied, a call should be made to |callback| with an empty list | 306 // request is denied, a call should be made to |callback| with an empty list |
| 306 // of devices. |request| has the details of the request (e.g. which of audio | 307 // of devices. |request| has the details of the request (e.g. which of audio |
| 307 // and/or video devices are requested, and lists of available devices). | 308 // and/or video devices are requested, and lists of available devices). |
| 308 virtual void RequestMediaAccessPermission( | 309 virtual void RequestMediaAccessPermission( |
| 309 const content::MediaStreamRequest* request, | 310 const MediaStreamRequest* request, |
| 310 const MediaResponseCallback& callback) = 0; | 311 const MediaResponseCallback& callback) = 0; |
| 311 | 312 |
| 312 // Asks permission to show desktop notifications. | 313 // Asks permission to show desktop notifications. |
| 313 virtual void RequestDesktopNotificationPermission( | 314 virtual void RequestDesktopNotificationPermission( |
| 314 const GURL& source_origin, | 315 const GURL& source_origin, |
| 315 int callback_context, | 316 int callback_context, |
| 316 int render_process_id, | 317 int render_process_id, |
| 317 int render_view_id) = 0; | 318 int render_view_id) = 0; |
| 318 | 319 |
| 319 // Checks if the given page has permission to show desktop notifications. | 320 // Checks if the given page has permission to show desktop notifications. |
| 320 // This is called on the IO thread. | 321 // This is called on the IO thread. |
| 321 virtual WebKit::WebNotificationPresenter::Permission | 322 virtual WebKit::WebNotificationPresenter::Permission |
| 322 CheckDesktopNotificationPermission( | 323 CheckDesktopNotificationPermission( |
| 323 const GURL& source_url, | 324 const GURL& source_url, |
| 324 content::ResourceContext* context, | 325 ResourceContext* context, |
| 325 int render_process_id) = 0; | 326 int render_process_id) = 0; |
| 326 | 327 |
| 327 // Show a desktop notification. If |worker| is true, the request came from an | 328 // Show a desktop notification. If |worker| is true, the request came from an |
| 328 // HTML5 web worker, otherwise, it came from a renderer. | 329 // HTML5 web worker, otherwise, it came from a renderer. |
| 329 virtual void ShowDesktopNotification( | 330 virtual void ShowDesktopNotification( |
| 330 const content::ShowDesktopNotificationHostMsgParams& params, | 331 const ShowDesktopNotificationHostMsgParams& params, |
| 331 int render_process_id, | 332 int render_process_id, |
| 332 int render_view_id, | 333 int render_view_id, |
| 333 bool worker) = 0; | 334 bool worker) = 0; |
| 334 | 335 |
| 335 // Cancels a displayed desktop notification. | 336 // Cancels a displayed desktop notification. |
| 336 virtual void CancelDesktopNotification( | 337 virtual void CancelDesktopNotification( |
| 337 int render_process_id, | 338 int render_process_id, |
| 338 int render_view_id, | 339 int render_view_id, |
| 339 int notification_id) = 0; | 340 int notification_id) = 0; |
| 340 | 341 |
| 341 // Returns true if the given page is allowed to open a window of the given | 342 // Returns true if the given page is allowed to open a window of the given |
| 342 // type. If true is returned, |no_javascript_access| will indicate whether | 343 // type. If true is returned, |no_javascript_access| will indicate whether |
| 343 // the window that is created should be scriptable/in the same process. | 344 // the window that is created should be scriptable/in the same process. |
| 344 // This is called on the IO thread. | 345 // This is called on the IO thread. |
| 345 virtual bool CanCreateWindow( | 346 virtual bool CanCreateWindow( |
| 346 const GURL& opener_url, | 347 const GURL& opener_url, |
| 347 const GURL& source_origin, | 348 const GURL& source_origin, |
| 348 WindowContainerType container_type, | 349 WindowContainerType container_type, |
| 349 content::ResourceContext* context, | 350 ResourceContext* context, |
| 350 int render_process_id, | 351 int render_process_id, |
| 351 bool* no_javascript_access) = 0; | 352 bool* no_javascript_access) = 0; |
| 352 | 353 |
| 353 // Returns a title string to use in the task manager for a process host with | 354 // Returns a title string to use in the task manager for a process host with |
| 354 // the given URL, or the empty string to fall back to the default logic. | 355 // the given URL, or the empty string to fall back to the default logic. |
| 355 // This is called on the IO thread. | 356 // This is called on the IO thread. |
| 356 virtual std::string GetWorkerProcessTitle( | 357 virtual std::string GetWorkerProcessTitle(const GURL& url, |
| 357 const GURL& url, content::ResourceContext* context) = 0; | 358 ResourceContext* context) = 0; |
| 358 | 359 |
| 359 // Notifies the embedder that the ResourceDispatcherHost has been created. | 360 // Notifies the embedder that the ResourceDispatcherHost has been created. |
| 360 // This is when it can optionally add a delegate or ResourceQueueDelegates. | 361 // This is when it can optionally add a delegate or ResourceQueueDelegates. |
| 361 virtual void ResourceDispatcherHostCreated() = 0; | 362 virtual void ResourceDispatcherHostCreated() = 0; |
| 362 | 363 |
| 363 // Allows the embedder to return a delegate for the SpeechRecognitionManager. | 364 // Allows the embedder to return a delegate for the SpeechRecognitionManager. |
| 364 // The delegate will be owned by the manager. It's valid to return NULL. | 365 // The delegate will be owned by the manager. It's valid to return NULL. |
| 365 virtual SpeechRecognitionManagerDelegate* | 366 virtual SpeechRecognitionManagerDelegate* |
| 366 GetSpeechRecognitionManagerDelegate() = 0; | 367 GetSpeechRecognitionManagerDelegate() = 0; |
| 367 | 368 |
| 368 // Getters for common objects. | 369 // Getters for common objects. |
| 369 virtual ui::Clipboard* GetClipboard() = 0; | 370 virtual ui::Clipboard* GetClipboard() = 0; |
| 370 virtual net::NetLog* GetNetLog() = 0; | 371 virtual net::NetLog* GetNetLog() = 0; |
| 371 | 372 |
| 372 // Creates a new AccessTokenStore for gelocation. | 373 // Creates a new AccessTokenStore for gelocation. |
| 373 virtual AccessTokenStore* CreateAccessTokenStore() = 0; | 374 virtual AccessTokenStore* CreateAccessTokenStore() = 0; |
| 374 | 375 |
| 375 // Returns true if fast shutdown is possible. | 376 // Returns true if fast shutdown is possible. |
| 376 virtual bool IsFastShutdownPossible() = 0; | 377 virtual bool IsFastShutdownPossible() = 0; |
| 377 | 378 |
| 378 // Called by WebContents to override the WebKit preferences that are used by | 379 // Called by WebContents to override the WebKit preferences that are used by |
| 379 // the renderer. The content layer will add its own settings, and then it's up | 380 // the renderer. The content layer will add its own settings, and then it's up |
| 380 // to the embedder to update it if it wants. | 381 // to the embedder to update it if it wants. |
| 381 virtual void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, | 382 virtual void OverrideWebkitPrefs(RenderViewHost* render_view_host, |
| 382 const GURL& url, | 383 const GURL& url, |
| 383 webkit_glue::WebPreferences* prefs) = 0; | 384 webkit_glue::WebPreferences* prefs) = 0; |
| 384 | 385 |
| 385 // Inspector setting was changed and should be persisted. | 386 // Inspector setting was changed and should be persisted. |
| 386 virtual void UpdateInspectorSetting(content::RenderViewHost* rvh, | 387 virtual void UpdateInspectorSetting(RenderViewHost* rvh, |
| 387 const std::string& key, | 388 const std::string& key, |
| 388 const std::string& value) = 0; | 389 const std::string& value) = 0; |
| 389 | 390 |
| 390 // Clear the Inspector settings. | 391 // Clear the Inspector settings. |
| 391 virtual void ClearInspectorSettings(content::RenderViewHost* rvh) = 0; | 392 virtual void ClearInspectorSettings(RenderViewHost* rvh) = 0; |
| 392 | 393 |
| 393 // Notifies that BrowserURLHandler has been created, so that the embedder can | 394 // Notifies that BrowserURLHandler has been created, so that the embedder can |
| 394 // optionally add their own handlers. | 395 // optionally add their own handlers. |
| 395 virtual void BrowserURLHandlerCreated(BrowserURLHandler* handler) = 0; | 396 virtual void BrowserURLHandlerCreated(BrowserURLHandler* handler) = 0; |
| 396 | 397 |
| 397 // Clears browser cache. | 398 // Clears browser cache. |
| 398 virtual void ClearCache(content::RenderViewHost* rvh) = 0; | 399 virtual void ClearCache(RenderViewHost* rvh) = 0; |
| 399 | 400 |
| 400 // Clears browser cookies. | 401 // Clears browser cookies. |
| 401 virtual void ClearCookies(content::RenderViewHost* rvh) = 0; | 402 virtual void ClearCookies(RenderViewHost* rvh) = 0; |
| 402 | 403 |
| 403 // Returns the default download directory. | 404 // Returns the default download directory. |
| 404 // This can be called on any thread. | 405 // This can be called on any thread. |
| 405 virtual FilePath GetDefaultDownloadDirectory() = 0; | 406 virtual FilePath GetDefaultDownloadDirectory() = 0; |
| 406 | 407 |
| 407 // Returns the default filename used in downloads when we have no idea what | 408 // Returns the default filename used in downloads when we have no idea what |
| 408 // else we should do with the file. | 409 // else we should do with the file. |
| 409 virtual std::string GetDefaultDownloadName() = 0; | 410 virtual std::string GetDefaultDownloadName() = 0; |
| 410 | 411 |
| 411 // Returns true if given origin can use TCP/UDP sockets. | 412 // Returns true if given origin can use TCP/UDP sockets. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 428 // This is called on a worker thread. | 429 // This is called on a worker thread. |
| 429 virtual | 430 virtual |
| 430 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( | 431 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( |
| 431 const GURL& url) = 0; | 432 const GURL& url) = 0; |
| 432 #endif | 433 #endif |
| 433 }; | 434 }; |
| 434 | 435 |
| 435 } // namespace content | 436 } // namespace content |
| 436 | 437 |
| 437 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 438 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |