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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
12 #include "base/path_service.h" | 12 #include "base/path_service.h" |
13 #include "base/string_tokenizer.h" | 13 #include "base/string_tokenizer.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/common/child_process_logging.h" | 16 #include "chrome/common/child_process_logging.h" |
17 #include "chrome/common/chrome_content_client.h" | 17 #include "chrome/common/chrome_content_client.h" |
18 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
19 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
20 #include "chrome/common/content_settings_pattern.h" | 20 #include "chrome/common/content_settings_pattern.h" |
21 #include "chrome/common/external_ipc_fuzzer.h" | 21 #include "chrome/common/external_ipc_fuzzer.h" |
22 #include "chrome/common/extensions/extension.h" | 22 #include "chrome/common/extensions/extension.h" |
23 #include "chrome/common/extensions/extension_constants.h" | 23 #include "chrome/common/extensions/extension_constants.h" |
24 #include "chrome/common/extensions/extension_process_policy.h" | 24 #include "chrome/common/extensions/extension_process_policy.h" |
25 #include "chrome/common/extensions/extension_set.h" | 25 #include "chrome/common/extensions/extension_set.h" |
26 #include "chrome/common/jstemplate_builder.h" | 26 #include "chrome/common/jstemplate_builder.h" |
| 27 #include "chrome/common/prerender_messages.h" |
27 #include "chrome/common/render_messages.h" | 28 #include "chrome/common/render_messages.h" |
28 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
29 #include "chrome/renderer/autofill/autofill_agent.h" | 30 #include "chrome/renderer/autofill/autofill_agent.h" |
30 #include "chrome/renderer/autofill/password_autofill_manager.h" | 31 #include "chrome/renderer/autofill/password_autofill_manager.h" |
31 #include "chrome/renderer/autofill/password_generation_manager.h" | 32 #include "chrome/renderer/autofill/password_generation_manager.h" |
32 #include "chrome/renderer/automation/automation_renderer_helper.h" | 33 #include "chrome/renderer/automation/automation_renderer_helper.h" |
33 #include "chrome/renderer/benchmarking_extension.h" | 34 #include "chrome/renderer/benchmarking_extension.h" |
34 #include "chrome/renderer/chrome_ppapi_interfaces.h" | 35 #include "chrome/renderer/chrome_ppapi_interfaces.h" |
35 #include "chrome/renderer/chrome_render_process_observer.h" | 36 #include "chrome/renderer/chrome_render_process_observer.h" |
36 #include "chrome/renderer/chrome_render_view_observer.h" | 37 #include "chrome/renderer/chrome_render_view_observer.h" |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 | 746 |
746 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { | 747 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { |
747 return visited_link_slave_->IsVisited(link_hash); | 748 return visited_link_slave_->IsVisited(link_hash); |
748 } | 749 } |
749 | 750 |
750 void ChromeContentRendererClient::PrefetchHostName(const char* hostname, | 751 void ChromeContentRendererClient::PrefetchHostName(const char* hostname, |
751 size_t length) { | 752 size_t length) { |
752 net_predictor_->Resolve(hostname, length); | 753 net_predictor_->Resolve(hostname, length); |
753 } | 754 } |
754 | 755 |
| 756 void ChromeContentRendererClient::NewLinkPrerender( |
| 757 int prerender_id, |
| 758 int render_view_route_id, |
| 759 const GURL& url, |
| 760 const content::Referrer& referrer, |
| 761 const gfx::Size& size) { |
| 762 RenderThread::Get()->Send(new PrerenderMsg_NewLinkPrerender( |
| 763 prerender_id, render_view_route_id, GURL(url), referrer, size)); |
| 764 } |
| 765 |
| 766 void ChromeContentRendererClient::RemovedLinkPrerender(int prerender_id) { |
| 767 RenderThread::Get()->Send(new PrerenderMsg_RemovedLinkPrerender( |
| 768 prerender_id)); |
| 769 } |
| 770 |
| 771 void ChromeContentRendererClient::UnloadedLinkPrerender(int prerender_id) { |
| 772 RenderThread::Get()->Send(new PrerenderMsg_UnloadedLinkPrerender( |
| 773 prerender_id)); |
| 774 } |
| 775 |
755 bool ChromeContentRendererClient::ShouldOverridePageVisibilityState( | 776 bool ChromeContentRendererClient::ShouldOverridePageVisibilityState( |
756 const content::RenderView* render_view, | 777 const content::RenderView* render_view, |
757 WebKit::WebPageVisibilityState* override_state) const { | 778 WebKit::WebPageVisibilityState* override_state) const { |
758 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) | 779 if (!prerender::PrerenderHelper::IsPrerendering(render_view)) |
759 return false; | 780 return false; |
760 | 781 |
761 *override_state = WebKit::WebPageVisibilityStatePrerender; | 782 *override_state = WebKit::WebPageVisibilityStatePrerender; |
762 return true; | 783 return true; |
763 } | 784 } |
764 | 785 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 881 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
861 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 882 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
862 } | 883 } |
863 | 884 |
864 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 885 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
865 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 886 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
866 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 887 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
867 } | 888 } |
868 | 889 |
869 } // namespace chrome | 890 } // namespace chrome |
OLD | NEW |