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 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "chrome/renderer/playback_extension.h" | 52 #include "chrome/renderer/playback_extension.h" |
53 #include "chrome/renderer/plugins/plugin_placeholder.h" | 53 #include "chrome/renderer/plugins/plugin_placeholder.h" |
54 #include "chrome/renderer/plugins/plugin_uma.h" | 54 #include "chrome/renderer/plugins/plugin_uma.h" |
55 #include "chrome/renderer/prerender/prerender_dispatcher.h" | 55 #include "chrome/renderer/prerender/prerender_dispatcher.h" |
56 #include "chrome/renderer/prerender/prerender_helper.h" | 56 #include "chrome/renderer/prerender/prerender_helper.h" |
57 #include "chrome/renderer/prerender/prerender_webmediaplayer.h" | 57 #include "chrome/renderer/prerender/prerender_webmediaplayer.h" |
58 #include "chrome/renderer/prerender/prerenderer_client.h" | 58 #include "chrome/renderer/prerender/prerenderer_client.h" |
59 #include "chrome/renderer/print_web_view_helper.h" | 59 #include "chrome/renderer/print_web_view_helper.h" |
60 #include "chrome/renderer/safe_browsing/malware_dom_details.h" | 60 #include "chrome/renderer/safe_browsing/malware_dom_details.h" |
61 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 61 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
62 #include "chrome/renderer/search_extension.h" | |
63 #include "chrome/renderer/searchbox.h" | 62 #include "chrome/renderer/searchbox.h" |
64 #include "chrome/renderer/searchbox_extension.h" | 63 #include "chrome/renderer/searchbox_extension.h" |
65 #include "chrome/renderer/spellchecker/spellcheck.h" | 64 #include "chrome/renderer/spellchecker/spellcheck.h" |
66 #include "chrome/renderer/spellchecker/spellcheck_provider.h" | 65 #include "chrome/renderer/spellchecker/spellcheck_provider.h" |
67 #include "chrome/renderer/translate_helper.h" | 66 #include "chrome/renderer/translate_helper.h" |
68 #include "chrome/renderer/visitedlink_slave.h" | 67 #include "chrome/renderer/visitedlink_slave.h" |
69 #include "content/public/common/content_constants.h" | 68 #include "content/public/common/content_constants.h" |
70 #include "content/public/renderer/render_thread.h" | 69 #include "content/public/renderer/render_thread.h" |
71 #include "content/public/renderer/render_view.h" | 70 #include "content/public/renderer/render_view.h" |
72 #include "grit/generated_resources.h" | 71 #include "grit/generated_resources.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 #if defined(ENABLE_SAFE_BROWSING) | 170 #if defined(ENABLE_SAFE_BROWSING) |
172 thread->AddObserver(phishing_classifier_.get()); | 171 thread->AddObserver(phishing_classifier_.get()); |
173 #endif | 172 #endif |
174 thread->AddObserver(spellcheck_.get()); | 173 thread->AddObserver(spellcheck_.get()); |
175 thread->AddObserver(visited_link_slave_.get()); | 174 thread->AddObserver(visited_link_slave_.get()); |
176 thread->AddObserver(prerender_dispatcher_.get()); | 175 thread->AddObserver(prerender_dispatcher_.get()); |
177 | 176 |
178 thread->RegisterExtension(extensions_v8::ExternalExtension::Get()); | 177 thread->RegisterExtension(extensions_v8::ExternalExtension::Get()); |
179 thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); | 178 thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); |
180 thread->RegisterExtension(extensions_v8::SearchBoxExtension::Get()); | 179 thread->RegisterExtension(extensions_v8::SearchBoxExtension::Get()); |
181 v8::Extension* search_extension = extensions_v8::SearchExtension::Get(); | |
182 // search_extension is null if not enabled. | |
183 if (search_extension) | |
184 thread->RegisterExtension(search_extension); | |
185 | 180 |
186 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 181 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
187 if (command_line->HasSwitch(switches::kEnableBenchmarking)) | 182 if (command_line->HasSwitch(switches::kEnableBenchmarking)) |
188 thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); | 183 thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); |
189 | 184 |
190 if (command_line->HasSwitch(switches::kPlaybackMode) || | 185 if (command_line->HasSwitch(switches::kPlaybackMode) || |
191 command_line->HasSwitch(switches::kRecordMode) || | 186 command_line->HasSwitch(switches::kRecordMode) || |
192 command_line->HasSwitch(switches::kNoJsRandomness)) { | 187 command_line->HasSwitch(switches::kNoJsRandomness)) { |
193 thread->RegisterExtension(extensions_v8::PlaybackExtension::Get()); | 188 thread->RegisterExtension(extensions_v8::PlaybackExtension::Get()); |
194 } | 189 } |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { | 947 bool ChromeContentRendererClient::IsOtherExtensionWithWebRequestInstalled() { |
953 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); | 948 return extension_dispatcher_->IsOtherExtensionWithWebRequestInstalled(); |
954 } | 949 } |
955 | 950 |
956 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 951 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
957 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 952 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
958 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 953 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
959 } | 954 } |
960 | 955 |
961 } // namespace chrome | 956 } // namespace chrome |
OLD | NEW |