| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/debugger/devtools_handler.h" | 7 #include "chrome/browser/debugger/devtools_handler.h" |
| 8 #include "chrome/browser/desktop_notification_handler.h" | 8 #include "chrome/browser/desktop_notification_handler.h" |
| 9 #include "chrome/browser/extensions/extension_message_handler.h" | 9 #include "chrome/browser/extensions/extension_message_handler.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 RenderViewHost* render_view_host, | 30 RenderViewHost* render_view_host, |
| 31 Profile* profile, | 31 Profile* profile, |
| 32 const GURL& url) { | 32 const GURL& url) { |
| 33 // Tell the RenderViewHost whether it will be used for an extension process. | 33 // Tell the RenderViewHost whether it will be used for an extension process. |
| 34 ExtensionService* service = profile->GetExtensionService(); | 34 ExtensionService* service = profile->GetExtensionService(); |
| 35 if (service) { | 35 if (service) { |
| 36 bool is_extension_process = service->ExtensionBindingsAllowed(url); | 36 bool is_extension_process = service->ExtensionBindingsAllowed(url); |
| 37 render_view_host->set_is_extension_process(is_extension_process); | 37 render_view_host->set_is_extension_process(is_extension_process); |
| 38 | 38 |
| 39 const Extension* installed_app = service->GetInstalledApp(url); | 39 const Extension* installed_app = service->GetInstalledApp(url); |
| 40 static_cast<BrowserRenderProcessHost*>(render_view_host->process())-> | 40 if (installed_app) { |
| 41 set_installed_app(installed_app); | 41 service->SetInstalledAppForRenderer( |
| 42 render_view_host->process()->id(), installed_app); |
| 43 } |
| 42 } | 44 } |
| 43 } | 45 } |
| 44 | 46 |
| 45 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( | 47 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( |
| 46 BrowserRenderProcessHost* host) { | 48 BrowserRenderProcessHost* host) { |
| 47 host->channel()->AddFilter(new ChromeRenderMessageFilter( | 49 host->channel()->AddFilter(new ChromeRenderMessageFilter( |
| 48 host->id(), | 50 host->id(), |
| 49 host->profile(), | 51 host->profile(), |
| 50 host->profile()->GetRequestContextForPossibleApp( | 52 host->profile()->GetRequestContextForRenderProcess(host->id()))); |
| 51 host->installed_app()))); | |
| 52 host->channel()->AddFilter(new PrintingMessageFilter()); | 53 host->channel()->AddFilter(new PrintingMessageFilter()); |
| 53 host->channel()->AddFilter( | 54 host->channel()->AddFilter( |
| 54 new SearchProviderInstallStateMessageFilter(host->id(), host->profile())); | 55 new SearchProviderInstallStateMessageFilter(host->id(), host->profile())); |
| 55 host->channel()->AddFilter(new SpellCheckMessageFilter()); | 56 host->channel()->AddFilter(new SpellCheckMessageFilter()); |
| 56 } | 57 } |
| 57 | 58 |
| 58 content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { | 59 content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { |
| 59 return ChromeWebUIFactory::GetInstance(); | 60 return ChromeWebUIFactory::GetInstance(); |
| 60 } | 61 } |
| 61 | 62 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 72 profile->GetExtensionService()->GetExtensionByWebExtent(url); | 73 profile->GetExtensionService()->GetExtensionByWebExtent(url); |
| 73 if (!extension) | 74 if (!extension) |
| 74 return url; | 75 return url; |
| 75 | 76 |
| 76 // If the URL is part of an extension's web extent, convert it to an | 77 // If the URL is part of an extension's web extent, convert it to an |
| 77 // extension URL. | 78 // extension URL. |
| 78 return extension->GetResourceURL(url.path()); | 79 return extension->GetResourceURL(url.path()); |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace chrome | 82 } // namespace chrome |
| OLD | NEW |