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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" | 46 #include "chrome/browser/renderer_host/chrome_render_view_host_observer.h" |
47 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" | 47 #include "chrome/browser/renderer_host/plugin_info_message_filter.h" |
48 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" | 48 #include "chrome/browser/search_engines/search_provider_install_state_message_fi
lter.h" |
49 #include "chrome/browser/speech/chrome_speech_input_manager.h" | 49 #include "chrome/browser/speech/chrome_speech_input_manager.h" |
50 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" | 50 #include "chrome/browser/spellchecker/spellcheck_message_filter.h" |
51 #include "chrome/browser/ssl/ssl_add_cert_handler.h" | 51 #include "chrome/browser/ssl/ssl_add_cert_handler.h" |
52 #include "chrome/browser/ssl/ssl_blocking_page.h" | 52 #include "chrome/browser/ssl/ssl_blocking_page.h" |
53 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" | 53 #include "chrome/browser/tab_contents/tab_contents_ssl_helper.h" |
54 #include "chrome/browser/tab_contents/tab_util.h" | 54 #include "chrome/browser/tab_contents/tab_util.h" |
55 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 55 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
56 #include "chrome/browser/ui/webui/chrome_web_ui_factory.h" | 56 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
57 #include "chrome/browser/user_style_sheet_watcher.h" | 57 #include "chrome/browser/user_style_sheet_watcher.h" |
58 #include "chrome/common/child_process_logging.h" | 58 #include "chrome/common/child_process_logging.h" |
59 #include "chrome/common/chrome_constants.h" | 59 #include "chrome/common/chrome_constants.h" |
60 #include "chrome/common/chrome_switches.h" | 60 #include "chrome/common/chrome_switches.h" |
61 #include "chrome/common/extensions/extension.h" | 61 #include "chrome/common/extensions/extension.h" |
62 #include "chrome/common/extensions/extension_set.h" | 62 #include "chrome/common/extensions/extension_set.h" |
63 #include "chrome/common/logging_chrome.h" | 63 #include "chrome/common/logging_chrome.h" |
64 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
65 #include "chrome/common/render_messages.h" | 65 #include "chrome/common/render_messages.h" |
66 #include "chrome/common/url_constants.h" | 66 #include "chrome/common/url_constants.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 | 133 |
134 using content::AccessTokenStore; | 134 using content::AccessTokenStore; |
135 using content::BrowserThread; | 135 using content::BrowserThread; |
136 using content::SiteInstance; | 136 using content::SiteInstance; |
137 using content::WebContents; | 137 using content::WebContents; |
138 | 138 |
139 namespace { | 139 namespace { |
140 | 140 |
141 // Handles rewriting Web UI URLs. | 141 // Handles rewriting Web UI URLs. |
142 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { | 142 bool HandleWebUI(GURL* url, content::BrowserContext* browser_context) { |
143 if (!ChromeWebUIFactory::GetInstance()->UseWebUIForURL(browser_context, *url)) | 143 if (!ChromeWebUIControllerFactory::GetInstance()->UseWebUIForURL( |
| 144 browser_context, *url)) |
144 return false; | 145 return false; |
145 | 146 |
146 // Special case the new tab page. In older versions of Chrome, the new tab | 147 // Special case the new tab page. In older versions of Chrome, the new tab |
147 // page was hosted at chrome-internal:<blah>. This might be in people's saved | 148 // page was hosted at chrome-internal:<blah>. This might be in people's saved |
148 // sessions or bookmarks, so we say any URL with that scheme triggers the new | 149 // sessions or bookmarks, so we say any URL with that scheme triggers the new |
149 // tab page. | 150 // tab page. |
150 if (url->SchemeIs(chrome::kChromeInternalScheme)) { | 151 if (url->SchemeIs(chrome::kChromeInternalScheme)) { |
151 // Rewrite it with the proper new tab URL. | 152 // Rewrite it with the proper new tab URL. |
152 *url = GURL(chrome::kChromeUINewTabURL); | 153 *url = GURL(chrome::kChromeUINewTabURL); |
153 } | 154 } |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 352 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
352 profile->IsOffTheRecord())); | 353 profile->IsOffTheRecord())); |
353 | 354 |
354 SendExtensionWebRequestStatusToHost(host); | 355 SendExtensionWebRequestStatusToHost(host); |
355 | 356 |
356 RendererContentSettingRules rules; | 357 RendererContentSettingRules rules; |
357 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); | 358 GetRendererContentSettingRules(profile->GetHostContentSettingsMap(), &rules); |
358 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); | 359 host->Send(new ChromeViewMsg_SetContentSettingRules(rules)); |
359 } | 360 } |
360 | 361 |
361 content::WebUIFactory* ChromeContentBrowserClient::GetWebUIFactory() { | 362 content::WebUIControllerFactory* |
362 return ChromeWebUIFactory::GetInstance(); | 363 ChromeContentBrowserClient::GetWebUIControllerFactory() { |
| 364 return ChromeWebUIControllerFactory::GetInstance(); |
363 } | 365 } |
364 | 366 |
365 GURL ChromeContentBrowserClient::GetEffectiveURL( | 367 GURL ChromeContentBrowserClient::GetEffectiveURL( |
366 content::BrowserContext* browser_context, const GURL& url) { | 368 content::BrowserContext* browser_context, const GURL& url) { |
367 Profile* profile = Profile::FromBrowserContext(browser_context); | 369 Profile* profile = Profile::FromBrowserContext(browser_context); |
368 // Get the effective URL for the given actual URL. If the URL is part of an | 370 // Get the effective URL for the given actual URL. If the URL is part of an |
369 // installed app, the effective URL is an extension URL with the ID of that | 371 // installed app, the effective URL is an extension URL with the ID of that |
370 // extension as the host. This has the effect of grouping apps together in | 372 // extension as the host. This has the effect of grouping apps together in |
371 // a common SiteInstance. | 373 // a common SiteInstance. |
372 if (!profile || !profile->GetExtensionService()) | 374 if (!profile || !profile->GetExtensionService()) |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1472 #if defined(USE_NSS) | 1474 #if defined(USE_NSS) |
1473 crypto::CryptoModuleBlockingPasswordDelegate* | 1475 crypto::CryptoModuleBlockingPasswordDelegate* |
1474 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1476 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1475 const GURL& url) { | 1477 const GURL& url) { |
1476 return browser::NewCryptoModuleBlockingDialogDelegate( | 1478 return browser::NewCryptoModuleBlockingDialogDelegate( |
1477 browser::kCryptoModulePasswordKeygen, url.host()); | 1479 browser::kCryptoModulePasswordKeygen, url.host()); |
1478 } | 1480 } |
1479 #endif | 1481 #endif |
1480 | 1482 |
1481 } // namespace chrome | 1483 } // namespace chrome |
OLD | NEW |