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/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/renderer_host/browser_render_process_host.h" | 9 #include "chrome/browser/renderer_host/browser_render_process_host.h" |
| 10 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" |
10 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
11 | 12 |
12 namespace chrome { | 13 namespace chrome { |
13 | 14 |
14 void ChromeContentBrowserClient::PreCreateRenderView( | 15 void ChromeContentBrowserClient::PreCreateRenderView( |
15 RenderViewHost* render_view_host, | 16 RenderViewHost* render_view_host, |
16 Profile* profile, | 17 Profile* profile, |
17 const GURL& url) { | 18 const GURL& url) { |
18 // Tell the RenderViewHost whether it will be used for an extension process. | 19 // Tell the RenderViewHost whether it will be used for an extension process. |
19 ExtensionService* service = profile->GetExtensionService(); | 20 ExtensionService* service = profile->GetExtensionService(); |
20 if (service) { | 21 if (service) { |
21 bool is_extension_process = service->ExtensionBindingsAllowed(url); | 22 bool is_extension_process = service->ExtensionBindingsAllowed(url); |
22 render_view_host->set_is_extension_process(is_extension_process); | 23 render_view_host->set_is_extension_process(is_extension_process); |
23 | 24 |
24 const Extension* installed_app = service->GetInstalledApp(url); | 25 const Extension* installed_app = service->GetInstalledApp(url); |
25 static_cast<BrowserRenderProcessHost*>(render_view_host->process())-> | 26 static_cast<BrowserRenderProcessHost*>(render_view_host->process())-> |
26 set_installed_app(installed_app); | 27 set_installed_app(installed_app); |
27 } | 28 } |
28 } | 29 } |
29 | 30 |
| 31 content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { |
| 32 return ChromeWebUIFactory::GetInstance(); |
| 33 } |
| 34 |
30 } // namespace chrome | 35 } // namespace chrome |
OLD | NEW |