| 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 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 ResourceContext* context, | 255 ResourceContext* context, |
| 256 const std::vector<std::pair<int, int> >& render_views); | 256 const std::vector<std::pair<int, int> >& render_views); |
| 257 | 257 |
| 258 // Allow the embedder to override the request context based on the URL for | 258 // Allow the embedder to override the request context based on the URL for |
| 259 // certain operations, like cookie access. Returns NULL to indicate the | 259 // certain operations, like cookie access. Returns NULL to indicate the |
| 260 // regular request context should be used. | 260 // regular request context should be used. |
| 261 // This is called on the IO thread. | 261 // This is called on the IO thread. |
| 262 virtual net::URLRequestContext* OverrideRequestContextForURL( | 262 virtual net::URLRequestContext* OverrideRequestContextForURL( |
| 263 const GURL& url, ResourceContext* context); | 263 const GURL& url, ResourceContext* context); |
| 264 | 264 |
| 265 // Allow the embedder to specify storage parititon id associated with a child | 265 // Allow the embedder to specify storage parititon id associated with a site. |
| 266 // process. | |
| 267 // | |
| 268 // Child processes that have different storage partition identifiers will | |
| 269 // behave as if they belong to different web browsers and not be able to | |
| 270 // access each other's cookies, local storage, etc. IDs must only fit the | |
| 271 // pattern [a-z0-9]* (lowercase letters or digits). | |
| 272 // | |
| 273 // Returns the empty string for the regular storage partition. | |
| 274 virtual std::string GetStoragePartitionIdForChildProcess( | |
| 275 content::BrowserContext* browser_context, | |
| 276 int child_process_id); | |
| 277 | |
| 278 // Same as GetStoragePartitionIdForChildProcess(), but uses a site instead. | |
| 279 // | |
| 280 // TODO(ajwong): Replace all uses of GetStoragePartitionIdForChildProcess() | |
| 281 // with this one. | |
| 282 virtual std::string GetStoragePartitionIdForSite( | 266 virtual std::string GetStoragePartitionIdForSite( |
| 283 content::BrowserContext* browser_context, | 267 content::BrowserContext* browser_context, |
| 284 const GURL& site); | 268 const GURL& site); |
| 285 | 269 |
| 286 // Allows the embedder to provide a validation check for |partition_id|s. | 270 // Allows the embedder to provide a validation check for |partition_id|s. |
| 287 // This domain of valid entries should match the range of outputs for | 271 // This domain of valid entries should match the range of outputs for |
| 288 // GetStoragePartitionIdForChildProcess(). | 272 // GetStoragePartitionIdForChildProcess(). |
| 289 virtual bool IsValidStoragePartitionId(BrowserContext* browser_context, | 273 virtual bool IsValidStoragePartitionId(BrowserContext* browser_context, |
| 290 const std::string& partition_id); | 274 const std::string& partition_id); |
| 291 | 275 |
| 276 // Allow the embedder to provide storage parititon description associated with |
| 277 // a site. |
| 278 virtual void GetStoragePartitionConfigForSite( |
| 279 content::BrowserContext* browser_context, |
| 280 const GURL& site, |
| 281 std::string* partition_domain, |
| 282 std::string* partition_name, |
| 283 bool* in_memory); |
| 284 |
| 292 // Create and return a new quota permission context. | 285 // Create and return a new quota permission context. |
| 293 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); | 286 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); |
| 294 | 287 |
| 295 // Open the given file in the desktop's default manner. | 288 // Open the given file in the desktop's default manner. |
| 296 virtual void OpenItem(const FilePath& path) {} | 289 virtual void OpenItem(const FilePath& path) {} |
| 297 | 290 |
| 298 // Show the given file in a file manager. If possible, select the file. | 291 // Show the given file in a file manager. If possible, select the file. |
| 299 virtual void ShowItemInFolder(const FilePath& path) {} | 292 virtual void ShowItemInFolder(const FilePath& path) {} |
| 300 | 293 |
| 301 // Informs the embedder that a certificate error has occured. If | 294 // Informs the embedder that a certificate error has occured. If |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 // This is called on a worker thread. | 463 // This is called on a worker thread. |
| 471 virtual | 464 virtual |
| 472 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( | 465 crypto::CryptoModuleBlockingPasswordDelegate* GetCryptoPasswordDelegate( |
| 473 const GURL& url); | 466 const GURL& url); |
| 474 #endif | 467 #endif |
| 475 }; | 468 }; |
| 476 | 469 |
| 477 } // namespace content | 470 } // namespace content |
| 478 | 471 |
| 479 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 472 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
| OLD | NEW |