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 <memory> | 7 #include <memory> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 #include "content/public/common/content_switches.h" | 87 #include "content/public/common/content_switches.h" |
88 #include "content/public/common/url_constants.h" | 88 #include "content/public/common/url_constants.h" |
89 #include "content/public/renderer/plugin_instance_throttler.h" | 89 #include "content/public/renderer/plugin_instance_throttler.h" |
90 #include "content/public/renderer/render_frame.h" | 90 #include "content/public/renderer/render_frame.h" |
91 #include "content/public/renderer/render_thread.h" | 91 #include "content/public/renderer/render_thread.h" |
92 #include "content/public/renderer/render_view.h" | 92 #include "content/public/renderer/render_view.h" |
93 #include "content/public/renderer/render_view_visitor.h" | 93 #include "content/public/renderer/render_view_visitor.h" |
94 #include "extensions/common/constants.h" | 94 #include "extensions/common/constants.h" |
95 #include "extensions/features/features.h" | 95 #include "extensions/features/features.h" |
96 #include "ipc/ipc_sync_channel.h" | 96 #include "ipc/ipc_sync_channel.h" |
| 97 #include "media/media_features.h" |
97 #include "net/base/net_errors.h" | 98 #include "net/base/net_errors.h" |
98 #include "ppapi/c/private/ppb_pdf.h" | 99 #include "ppapi/c/private/ppb_pdf.h" |
99 #include "ppapi/features/features.h" | 100 #include "ppapi/features/features.h" |
100 #include "ppapi/shared_impl/ppapi_switches.h" | 101 #include "ppapi/shared_impl/ppapi_switches.h" |
101 #include "printing/features/features.h" | 102 #include "printing/features/features.h" |
102 #include "services/service_manager/public/cpp/interface_provider.h" | 103 #include "services/service_manager/public/cpp/interface_provider.h" |
103 #include "third_party/WebKit/public/platform/URLConversion.h" | 104 #include "third_party/WebKit/public/platform/URLConversion.h" |
104 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 105 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
105 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 106 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
106 #include "third_party/WebKit/public/platform/WebURL.h" | 107 #include "third_party/WebKit/public/platform/WebURL.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 | 153 |
153 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 154 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
154 #include "chrome/renderer/pepper/chrome_pdf_print_client.h" | 155 #include "chrome/renderer/pepper/chrome_pdf_print_client.h" |
155 #endif | 156 #endif |
156 | 157 |
157 #if BUILDFLAG(ENABLE_SPELLCHECK) | 158 #if BUILDFLAG(ENABLE_SPELLCHECK) |
158 #include "components/spellcheck/renderer/spellcheck.h" | 159 #include "components/spellcheck/renderer/spellcheck.h" |
159 #include "components/spellcheck/renderer/spellcheck_provider.h" | 160 #include "components/spellcheck/renderer/spellcheck_provider.h" |
160 #endif | 161 #endif |
161 | 162 |
162 #if defined(ENABLE_WEBRTC) | 163 #if BUILDFLAG(ENABLE_WEBRTC) |
163 #include "chrome/renderer/media/webrtc_logging_message_filter.h" | 164 #include "chrome/renderer/media/webrtc_logging_message_filter.h" |
164 #endif | 165 #endif |
165 | 166 |
166 using autofill::AutofillAgent; | 167 using autofill::AutofillAgent; |
167 using autofill::PasswordAutofillAgent; | 168 using autofill::PasswordAutofillAgent; |
168 using autofill::PasswordGenerationAgent; | 169 using autofill::PasswordGenerationAgent; |
169 using base::ASCIIToUTF16; | 170 using base::ASCIIToUTF16; |
170 using base::UserMetricsAction; | 171 using base::UserMetricsAction; |
171 using blink::WebCache; | 172 using blink::WebCache; |
172 using blink::WebCachePolicy; | 173 using blink::WebCachePolicy; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 spellcheck_.reset(new SpellCheck()); | 345 spellcheck_.reset(new SpellCheck()); |
345 thread->AddObserver(spellcheck_.get()); | 346 thread->AddObserver(spellcheck_.get()); |
346 } | 347 } |
347 #endif | 348 #endif |
348 #if defined(FULL_SAFE_BROWSING) | 349 #if defined(FULL_SAFE_BROWSING) |
349 phishing_classifier_.reset(safe_browsing::PhishingClassifierFilter::Create()); | 350 phishing_classifier_.reset(safe_browsing::PhishingClassifierFilter::Create()); |
350 #endif | 351 #endif |
351 prerender_dispatcher_.reset(new prerender::PrerenderDispatcher()); | 352 prerender_dispatcher_.reset(new prerender::PrerenderDispatcher()); |
352 subresource_filter_ruleset_dealer_.reset( | 353 subresource_filter_ruleset_dealer_.reset( |
353 new subresource_filter::RulesetDealer()); | 354 new subresource_filter::RulesetDealer()); |
354 #if defined(ENABLE_WEBRTC) | 355 #if BUILDFLAG(ENABLE_WEBRTC) |
355 webrtc_logging_message_filter_ = | 356 webrtc_logging_message_filter_ = |
356 new WebRtcLoggingMessageFilter(thread->GetIOTaskRunner()); | 357 new WebRtcLoggingMessageFilter(thread->GetIOTaskRunner()); |
357 #endif | 358 #endif |
358 | 359 |
359 thread->AddObserver(chrome_observer_.get()); | 360 thread->AddObserver(chrome_observer_.get()); |
360 #if defined(FULL_SAFE_BROWSING) | 361 #if defined(FULL_SAFE_BROWSING) |
361 thread->AddObserver(phishing_classifier_.get()); | 362 thread->AddObserver(phishing_classifier_.get()); |
362 #endif | 363 #endif |
363 thread->AddObserver(prerender_dispatcher_.get()); | 364 thread->AddObserver(prerender_dispatcher_.get()); |
364 thread->AddObserver(subresource_filter_ruleset_dealer_.get()); | 365 thread->AddObserver(subresource_filter_ruleset_dealer_.get()); |
365 thread->AddObserver(SearchBouncer::GetInstance()); | 366 thread->AddObserver(SearchBouncer::GetInstance()); |
366 | 367 |
367 #if defined(ENABLE_WEBRTC) | 368 #if BUILDFLAG(ENABLE_WEBRTC) |
368 thread->AddFilter(webrtc_logging_message_filter_.get()); | 369 thread->AddFilter(webrtc_logging_message_filter_.get()); |
369 #endif | 370 #endif |
370 | 371 |
371 thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); | 372 thread->RegisterExtension(extensions_v8::LoadTimesExtension::Get()); |
372 | 373 |
373 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 374 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
374 if (command_line->HasSwitch(switches::kEnableBenchmarking)) | 375 if (command_line->HasSwitch(switches::kEnableBenchmarking)) |
375 thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); | 376 thread->RegisterExtension(extensions_v8::BenchmarkingExtension::Get()); |
376 if (command_line->HasSwitch(switches::kEnableNetBenchmarking)) | 377 if (command_line->HasSwitch(switches::kEnableNetBenchmarking)) |
377 thread->RegisterExtension(extensions_v8::NetBenchmarkingExtension::Get()); | 378 thread->RegisterExtension(extensions_v8::NetBenchmarkingExtension::Get()); |
(...skipping 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1471 | 1472 |
1472 url::Replacements<char> r; | 1473 url::Replacements<char> r; |
1473 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1474 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1474 | 1475 |
1475 if (result == internal::NUM_PLUGIN_ERROR) | 1476 if (result == internal::NUM_PLUGIN_ERROR) |
1476 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1477 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1477 | 1478 |
1478 RecordYouTubeRewriteUMA(result); | 1479 RecordYouTubeRewriteUMA(result); |
1479 return corrected_url.ReplaceComponents(r); | 1480 return corrected_url.ReplaceComponents(r); |
1480 } | 1481 } |
OLD | NEW |