Chromium Code Reviews| 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 #include "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 return main_parts; | 397 return main_parts; |
| 398 } | 398 } |
| 399 | 399 |
| 400 content::WebContentsView* | 400 content::WebContentsView* |
| 401 ChromeContentBrowserClient::OverrideCreateWebContentsView( | 401 ChromeContentBrowserClient::OverrideCreateWebContentsView( |
| 402 WebContents* web_contents, | 402 WebContents* web_contents, |
| 403 content::RenderViewHostDelegateView** render_view_host_delegate_view) { | 403 content::RenderViewHostDelegateView** render_view_host_delegate_view) { |
| 404 return NULL; | 404 return NULL; |
| 405 } | 405 } |
| 406 | 406 |
| 407 std::string ChromeContentBrowserClient::GetStoragePartitionIdForChildProcess( | |
| 408 content::BrowserContext* browser_context, | |
| 409 int child_process_id) { | |
| 410 // In chrome, we use the extension ID as the partition ID. This works well | |
| 411 // because the extension ID fits the partition ID pattern and currently only | |
| 412 // apps can designate that storage should be isolated. | |
| 413 Profile* profile = Profile::FromBrowserContext(browser_context); | |
| 414 ExtensionService* extension_service = | |
| 415 ExtensionSystem::Get(profile)->extension_service(); | |
| 416 if (extension_service) { | |
| 417 const extensions::Extension* installed_app = extension_service-> | |
| 418 GetInstalledAppForRenderer(child_process_id); | |
| 419 if (installed_app != NULL && installed_app->is_storage_isolated()) { | |
|
jam
2012/07/11 02:09:25
nit: i thought the convention was just
if (install
awong
2012/07/11 21:17:17
I wasn't aware of a convention, but happy to do it
| |
| 420 return installed_app->id(); | |
| 421 } | |
| 422 } | |
| 423 return std::string(); | |
| 424 } | |
| 425 | |
| 407 content::WebContentsViewDelegate* | 426 content::WebContentsViewDelegate* |
| 408 ChromeContentBrowserClient::GetWebContentsViewDelegate( | 427 ChromeContentBrowserClient::GetWebContentsViewDelegate( |
| 409 content::WebContents* web_contents) { | 428 content::WebContents* web_contents) { |
| 410 return chrome::CreateWebContentsViewDelegate(web_contents); | 429 return chrome::CreateWebContentsViewDelegate(web_contents); |
| 411 } | 430 } |
| 412 | 431 |
| 413 void ChromeContentBrowserClient::RenderViewHostCreated( | 432 void ChromeContentBrowserClient::RenderViewHostCreated( |
| 414 RenderViewHost* render_view_host) { | 433 RenderViewHost* render_view_host) { |
| 415 | 434 |
| 416 SiteInstance* site_instance = render_view_host->GetSiteInstance(); | 435 SiteInstance* site_instance = render_view_host->GetSiteInstance(); |
| (...skipping 1230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1647 io_thread_application_locale_ = locale; | 1666 io_thread_application_locale_ = locale; |
| 1648 } | 1667 } |
| 1649 | 1668 |
| 1650 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1669 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 1651 const std::string& locale) { | 1670 const std::string& locale) { |
| 1652 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1671 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 1653 io_thread_application_locale_ = locale; | 1672 io_thread_application_locale_ = locale; |
| 1654 } | 1673 } |
| 1655 | 1674 |
| 1656 } // namespace chrome | 1675 } // namespace chrome |
| OLD | NEW |