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/common/chrome_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "content/public/common/user_agent.h" | 42 #include "content/public/common/user_agent.h" |
43 #include "extensions/common/constants.h" | 43 #include "extensions/common/constants.h" |
44 #include "extensions/features/features.h" | 44 #include "extensions/features/features.h" |
45 #include "gpu/config/gpu_info.h" | 45 #include "gpu/config/gpu_info.h" |
46 #include "net/http/http_util.h" | 46 #include "net/http/http_util.h" |
47 #include "pdf/features.h" | 47 #include "pdf/features.h" |
48 #include "ppapi/features/features.h" | 48 #include "ppapi/features/features.h" |
49 #include "ui/base/l10n/l10n_util.h" | 49 #include "ui/base/l10n/l10n_util.h" |
50 #include "ui/base/layout.h" | 50 #include "ui/base/layout.h" |
51 #include "ui/base/resource/resource_bundle.h" | 51 #include "ui/base/resource/resource_bundle.h" |
| 52 #include "url/url_constants.h" |
52 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 53 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
53 | 54 |
54 #if defined(OS_LINUX) | 55 #if defined(OS_LINUX) |
55 #include <fcntl.h> | 56 #include <fcntl.h> |
56 #include "chrome/common/component_flash_hint_file_linux.h" | 57 #include "chrome/common/component_flash_hint_file_linux.h" |
57 #include "sandbox/linux/services/credentials.h" | 58 #include "sandbox/linux/services/credentials.h" |
58 #endif // defined(OS_LINUX) | 59 #endif // defined(OS_LINUX) |
59 | 60 |
60 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
61 #include "base/win/windows_version.h" | 62 #include "base/win/windows_version.h" |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 schemes->standard_schemes.push_back(standard_scheme); | 571 schemes->standard_schemes.push_back(standard_scheme); |
571 | 572 |
572 #if defined(OS_ANDROID) | 573 #if defined(OS_ANDROID) |
573 schemes->referrer_schemes.push_back(chrome::kAndroidAppScheme); | 574 schemes->referrer_schemes.push_back(chrome::kAndroidAppScheme); |
574 #endif | 575 #endif |
575 | 576 |
576 schemes->savable_schemes.push_back(extensions::kExtensionScheme); | 577 schemes->savable_schemes.push_back(extensions::kExtensionScheme); |
577 schemes->savable_schemes.push_back(chrome::kChromeSearchScheme); | 578 schemes->savable_schemes.push_back(chrome::kChromeSearchScheme); |
578 schemes->savable_schemes.push_back(dom_distiller::kDomDistillerScheme); | 579 schemes->savable_schemes.push_back(dom_distiller::kDomDistillerScheme); |
579 | 580 |
| 581 // chrome-search: resources shouldn't trigger insecure content warnings. |
580 schemes->secure_schemes.push_back(chrome::kChromeSearchScheme); | 582 schemes->secure_schemes.push_back(chrome::kChromeSearchScheme); |
581 schemes->secure_schemes.push_back(content::kChromeUIScheme); | 583 |
| 584 // Treat as secure because communication with them is entirely in the browser, |
| 585 // so there is no danger of manipulation or eavesdropping on communication |
| 586 // with them by third parties. |
582 schemes->secure_schemes.push_back(extensions::kExtensionScheme); | 587 schemes->secure_schemes.push_back(extensions::kExtensionScheme); |
| 588 |
583 schemes->secure_origins = GetSecureOriginWhitelist(); | 589 schemes->secure_origins = GetSecureOriginWhitelist(); |
584 | 590 |
| 591 schemes->no_access_schemes.push_back(chrome::kChromeNativeScheme); |
| 592 |
585 #if BUILDFLAG(ENABLE_EXTENSIONS) | 593 #if BUILDFLAG(ENABLE_EXTENSIONS) |
586 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) | 594 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) |
587 schemes->service_worker_schemes.push_back(extensions::kExtensionScheme); | 595 schemes->service_worker_schemes.push_back(extensions::kExtensionScheme); |
| 596 |
| 597 // As far as Blink is concerned, they should be allowed to receive CORS |
| 598 // requests. At the Extensions layer, requests will actually be blocked unless |
| 599 // overridden by the web_accessible_resources manifest key. |
| 600 // TODO(kalman): See what happens with a service worker. |
| 601 schemes->cors_enabled_schemes.push_back(extensions::kExtensionScheme); |
| 602 #endif |
| 603 |
| 604 #if defined(OS_CHROMEOS) |
| 605 schemes->local_schemes.push_back(content::kExternalFileScheme); |
| 606 #endif |
| 607 |
| 608 #if defined(OS_ANDROID) |
| 609 schemes->local_schemes.push_back(url::kContentScheme); |
588 #endif | 610 #endif |
589 } | 611 } |
590 | 612 |
591 std::string ChromeContentClient::GetProduct() const { | 613 std::string ChromeContentClient::GetProduct() const { |
592 return ::GetProduct(); | 614 return ::GetProduct(); |
593 } | 615 } |
594 | 616 |
595 std::string ChromeContentClient::GetUserAgent() const { | 617 std::string ChromeContentClient::GetUserAgent() const { |
596 return ::GetUserAgent(); | 618 return ::GetUserAgent(); |
597 } | 619 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
666 if (!origin_trial_policy_) | 688 if (!origin_trial_policy_) |
667 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 689 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
668 return origin_trial_policy_.get(); | 690 return origin_trial_policy_.get(); |
669 } | 691 } |
670 | 692 |
671 #if defined(OS_ANDROID) | 693 #if defined(OS_ANDROID) |
672 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 694 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
673 return new ChromeMediaClientAndroid(); | 695 return new ChromeMediaClientAndroid(); |
674 } | 696 } |
675 #endif // OS_ANDROID | 697 #endif // OS_ANDROID |
OLD | NEW |