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 1494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1505 const GURL& url) { | 1505 const GURL& url) { |
1506 #if !defined(OS_ANDROID) | 1506 #if !defined(OS_ANDROID) |
1507 // Allow only the Hangouts app to use the MediaStream APIs. It's OK to check | 1507 // Allow only the Hangouts app to use the MediaStream APIs. It's OK to check |
1508 // the whitelist in the renderer, since we're only preventing access until | 1508 // the whitelist in the renderer, since we're only preventing access until |
1509 // these APIs are public and stable. | 1509 // these APIs are public and stable. |
1510 std::string url_host = url.host(); | 1510 std::string url_host = url.host(); |
1511 if (url.SchemeIs("https") && | 1511 if (url.SchemeIs("https") && |
1512 (EndsWith(url_host, "talkgadget.google.com", false) || | 1512 (EndsWith(url_host, "talkgadget.google.com", false) || |
1513 EndsWith(url_host, "plus.google.com", false) || | 1513 EndsWith(url_host, "plus.google.com", false) || |
1514 EndsWith(url_host, "plus.sandbox.google.com", false)) && | 1514 EndsWith(url_host, "plus.sandbox.google.com", false)) && |
1515 StartsWithASCII(url.path(), "/hangouts/", false)) { | 1515 base::StartsWithASCII(url.path(), "/hangouts/", false)) { |
1516 return true; | 1516 return true; |
1517 } | 1517 } |
1518 // Allow access for tests. | 1518 // Allow access for tests. |
1519 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1519 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1520 switches::kEnablePepperTesting)) { | 1520 switches::kEnablePepperTesting)) { |
1521 return true; | 1521 return true; |
1522 } | 1522 } |
1523 #endif // !defined(OS_ANDROID) | 1523 #endif // !defined(OS_ANDROID) |
1524 return false; | 1524 return false; |
1525 } | 1525 } |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1648 WebString header_key(ASCIIToUTF16( | 1648 WebString header_key(ASCIIToUTF16( |
1649 data_reduction_proxy::chrome_proxy_header())); | 1649 data_reduction_proxy::chrome_proxy_header())); |
1650 if (!response.httpHeaderField(header_key).isNull() && | 1650 if (!response.httpHeaderField(header_key).isNull() && |
1651 response.httpHeaderField(header_key).utf8().find( | 1651 response.httpHeaderField(header_key).utf8().find( |
1652 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1652 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1653 std::string::npos) { | 1653 std::string::npos) { |
1654 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1654 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1655 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1655 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1656 } | 1656 } |
1657 } | 1657 } |
OLD | NEW |