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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 return true; | 1353 return true; |
1354 } | 1354 } |
1355 | 1355 |
1356 #if defined(ENABLE_EXTENSIONS) | 1356 #if defined(ENABLE_EXTENSIONS) |
1357 void ChromeContentRendererClient::SetExtensionDispatcherForTest( | 1357 void ChromeContentRendererClient::SetExtensionDispatcherForTest( |
1358 extensions::Dispatcher* extension_dispatcher) { | 1358 extensions::Dispatcher* extension_dispatcher) { |
1359 extension_dispatcher_.reset(extension_dispatcher); | 1359 extension_dispatcher_.reset(extension_dispatcher); |
1360 permissions_policy_delegate_.reset( | 1360 permissions_policy_delegate_.reset( |
1361 new extensions::RendererPermissionsPolicyDelegate( | 1361 new extensions::RendererPermissionsPolicyDelegate( |
1362 extension_dispatcher_.get())); | 1362 extension_dispatcher_.get())); |
| 1363 RenderThread::Get()->RegisterExtension( |
| 1364 extensions::SafeBuiltins::CreateV8Extension()); |
1363 } | 1365 } |
1364 | 1366 |
1365 extensions::Dispatcher* | 1367 extensions::Dispatcher* |
1366 ChromeContentRendererClient::GetExtensionDispatcherForTest() { | 1368 ChromeContentRendererClient::GetExtensionDispatcherForTest() { |
1367 return extension_dispatcher_.get(); | 1369 return extension_dispatcher_.get(); |
1368 } | 1370 } |
1369 | 1371 |
1370 bool ChromeContentRendererClient::CrossesExtensionExtents( | 1372 bool ChromeContentRendererClient::CrossesExtensionExtents( |
1371 blink::WebLocalFrame* frame, | 1373 blink::WebLocalFrame* frame, |
1372 const GURL& new_url, | 1374 const GURL& new_url, |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 WebString header_key(ASCIIToUTF16( | 1626 WebString header_key(ASCIIToUTF16( |
1625 data_reduction_proxy::chrome_proxy_header())); | 1627 data_reduction_proxy::chrome_proxy_header())); |
1626 if (!response.httpHeaderField(header_key).isNull() && | 1628 if (!response.httpHeaderField(header_key).isNull() && |
1627 response.httpHeaderField(header_key).utf8().find( | 1629 response.httpHeaderField(header_key).utf8().find( |
1628 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1630 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1629 std::string::npos) { | 1631 std::string::npos) { |
1630 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1632 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1631 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1633 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1632 } | 1634 } |
1633 } | 1635 } |
OLD | NEW |