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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 void ChromeContentBrowserClient::RenderViewHostCreated( | 322 void ChromeContentBrowserClient::RenderViewHostCreated( |
323 RenderViewHost* render_view_host) { | 323 RenderViewHost* render_view_host) { |
324 | 324 |
325 SiteInstance* site_instance = render_view_host->site_instance(); | 325 SiteInstance* site_instance = render_view_host->site_instance(); |
326 Profile* profile = Profile::FromBrowserContext( | 326 Profile* profile = Profile::FromBrowserContext( |
327 site_instance->GetBrowserContext()); | 327 site_instance->GetBrowserContext()); |
328 | 328 |
329 new ChromeRenderViewHostObserver(render_view_host, | 329 new ChromeRenderViewHostObserver(render_view_host, |
330 profile->GetNetworkPredictor()); | 330 profile->GetNetworkPredictor()); |
331 new ExtensionMessageHandler(render_view_host); | 331 new ExtensionMessageHandler(render_view_host); |
| 332 |
| 333 if (render_view_host->delegate()->GetRenderViewType() == |
| 334 content::VIEW_TYPE_INTERSTITIAL_PAGE) { |
| 335 render_view_host->Send(new ChromeViewMsg_SetAsInterstitial( |
| 336 render_view_host->routing_id())); |
| 337 } |
332 } | 338 } |
333 | 339 |
334 void ChromeContentBrowserClient::RenderProcessHostCreated( | 340 void ChromeContentBrowserClient::RenderProcessHostCreated( |
335 content::RenderProcessHost* host) { | 341 content::RenderProcessHost* host) { |
336 int id = host->GetID(); | 342 int id = host->GetID(); |
337 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 343 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
338 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( | 344 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( |
339 id, profile, profile->GetRequestContextForRenderProcess(id))); | 345 id, profile, profile->GetRequestContextForRenderProcess(id))); |
340 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); | 346 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); |
341 host->GetChannel()->AddFilter(new PrintingMessageFilter()); | 347 host->GetChannel()->AddFilter(new PrintingMessageFilter()); |
(...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 if (prerender_manager->prerender_tracker()->TryCancel( | 877 if (prerender_manager->prerender_tracker()->TryCancel( |
872 handler->render_process_host_id(), | 878 handler->render_process_host_id(), |
873 handler->tab_contents_id(), | 879 handler->tab_contents_id(), |
874 prerender::FINAL_STATUS_SSL_ERROR)) { | 880 prerender::FINAL_STATUS_SSL_ERROR)) { |
875 handler->CancelRequest(); | 881 handler->CancelRequest(); |
876 return; | 882 return; |
877 } | 883 } |
878 } | 884 } |
879 | 885 |
880 // Otherwise, display an SSL blocking page. | 886 // Otherwise, display an SSL blocking page. |
881 SSLBlockingPage* blocking_page = new SSLBlockingPage( | 887 new SSLBlockingPage(handler, overridable, callback); |
882 handler, overridable, callback); | |
883 blocking_page->Show(); | |
884 } | 888 } |
885 | 889 |
886 void ChromeContentBrowserClient::SelectClientCertificate( | 890 void ChromeContentBrowserClient::SelectClientCertificate( |
887 int render_process_id, | 891 int render_process_id, |
888 int render_view_id, | 892 int render_view_id, |
889 SSLClientAuthHandler* handler) { | 893 SSLClientAuthHandler* handler) { |
890 WebContents* tab = tab_util::GetWebContentsByID( | 894 WebContents* tab = tab_util::GetWebContentsByID( |
891 render_process_id, render_view_id); | 895 render_process_id, render_view_id); |
892 if (!tab) { | 896 if (!tab) { |
893 NOTREACHED(); | 897 NOTREACHED(); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1332 #if defined(USE_NSS) | 1336 #if defined(USE_NSS) |
1333 crypto::CryptoModuleBlockingPasswordDelegate* | 1337 crypto::CryptoModuleBlockingPasswordDelegate* |
1334 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1338 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1335 const GURL& url) { | 1339 const GURL& url) { |
1336 return browser::NewCryptoModuleBlockingDialogDelegate( | 1340 return browser::NewCryptoModuleBlockingDialogDelegate( |
1337 browser::kCryptoModulePasswordKeygen, url.host()); | 1341 browser::kCryptoModulePasswordKeygen, url.host()); |
1338 } | 1342 } |
1339 #endif | 1343 #endif |
1340 | 1344 |
1341 } // namespace chrome | 1345 } // namespace chrome |
OLD | NEW |