Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(191)

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 2479593006: Move enable extensions define to a build flag. (Closed)
Patch Set: Merge Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/common/DEPS ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 23 matching lines...) Expand all
34 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
35 #include "chrome/grit/common_resources.h" 35 #include "chrome/grit/common_resources.h"
36 #include "components/dom_distiller/core/url_constants.h" 36 #include "components/dom_distiller/core/url_constants.h"
37 #include "components/version_info/version_info.h" 37 #include "components/version_info/version_info.h"
38 #include "content/public/common/cdm_info.h" 38 #include "content/public/common/cdm_info.h"
39 #include "content/public/common/content_constants.h" 39 #include "content/public/common/content_constants.h"
40 #include "content/public/common/content_switches.h" 40 #include "content/public/common/content_switches.h"
41 #include "content/public/common/url_constants.h" 41 #include "content/public/common/url_constants.h"
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 "gpu/config/gpu_info.h" 45 #include "gpu/config/gpu_info.h"
45 #include "net/http/http_util.h" 46 #include "net/http/http_util.h"
46 #include "ppapi/features/features.h" 47 #include "ppapi/features/features.h"
47 #include "ui/base/l10n/l10n_util.h" 48 #include "ui/base/l10n/l10n_util.h"
48 #include "ui/base/layout.h" 49 #include "ui/base/layout.h"
49 #include "ui/base/resource/resource_bundle.h" 50 #include "ui/base/resource/resource_bundle.h"
50 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. 51 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR.
51 52
52 #if defined(OS_LINUX) 53 #if defined(OS_LINUX)
53 #include <fcntl.h> 54 #include <fcntl.h>
54 #include "chrome/common/component_flash_hint_file_linux.h" 55 #include "chrome/common/component_flash_hint_file_linux.h"
55 #include "sandbox/linux/services/credentials.h" 56 #include "sandbox/linux/services/credentials.h"
56 #endif // defined(OS_LINUX) 57 #endif // defined(OS_LINUX)
57 58
58 #if defined(OS_WIN) 59 #if defined(OS_WIN)
59 #include "base/win/windows_version.h" 60 #include "base/win/windows_version.h"
60 #endif 61 #endif
61 62
62 #if !defined(DISABLE_NACL) 63 #if !defined(DISABLE_NACL)
63 #include "components/nacl/common/nacl_constants.h" 64 #include "components/nacl/common/nacl_constants.h"
64 #include "components/nacl/common/nacl_process_type.h" 65 #include "components/nacl/common/nacl_process_type.h"
65 #include "components/nacl/common/nacl_sandbox_type.h" 66 #include "components/nacl/common/nacl_sandbox_type.h"
66 #endif 67 #endif
67 68
68 #if defined(ENABLE_EXTENSIONS) 69 #if BUILDFLAG(ENABLE_EXTENSIONS)
69 #include "chrome/common/extensions/extension_process_policy.h" 70 #include "chrome/common/extensions/extension_process_policy.h"
70 #include "extensions/common/features/feature_util.h" 71 #include "extensions/common/features/feature_util.h"
71 #endif 72 #endif
72 73
73 #if defined(ENABLE_PLUGINS) 74 #if defined(ENABLE_PLUGINS)
74 #include "content/public/common/pepper_plugin_info.h" 75 #include "content/public/common/pepper_plugin_info.h"
75 #include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR. 76 #include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR.
76 #include "ppapi/shared_impl/ppapi_permissions.h" 77 #include "ppapi/shared_impl/ppapi_permissions.h"
77 #endif 78 #endif
78 79
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
650 std::set<GURL>* origins) { 651 std::set<GURL>* origins) {
651 schemes->insert(chrome::kChromeSearchScheme); 652 schemes->insert(chrome::kChromeSearchScheme);
652 schemes->insert(content::kChromeUIScheme); 653 schemes->insert(content::kChromeUIScheme);
653 schemes->insert(extensions::kExtensionScheme); 654 schemes->insert(extensions::kExtensionScheme);
654 schemes->insert(extensions::kExtensionResourceScheme); 655 schemes->insert(extensions::kExtensionResourceScheme);
655 GetSecureOriginWhitelist(origins); 656 GetSecureOriginWhitelist(origins);
656 } 657 }
657 658
658 void ChromeContentClient::AddServiceWorkerSchemes( 659 void ChromeContentClient::AddServiceWorkerSchemes(
659 std::set<std::string>* schemes) { 660 std::set<std::string>* schemes) {
660 #if defined(ENABLE_EXTENSIONS) 661 #if BUILDFLAG(ENABLE_EXTENSIONS)
661 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) 662 if (extensions::feature_util::ExtensionServiceWorkersEnabled())
662 schemes->insert(extensions::kExtensionScheme); 663 schemes->insert(extensions::kExtensionScheme);
663 #endif 664 #endif
664 } 665 }
665 666
666 bool ChromeContentClient::AllowScriptExtensionForServiceWorker( 667 bool ChromeContentClient::AllowScriptExtensionForServiceWorker(
667 const GURL& script_url) { 668 const GURL& script_url) {
668 #if defined(ENABLE_EXTENSIONS) 669 #if BUILDFLAG(ENABLE_EXTENSIONS)
669 return script_url.SchemeIs(extensions::kExtensionScheme) || 670 return script_url.SchemeIs(extensions::kExtensionScheme) ||
670 script_url.SchemeIs(extensions::kExtensionResourceScheme); 671 script_url.SchemeIs(extensions::kExtensionResourceScheme);
671 #else 672 #else
672 return false; 673 return false;
673 #endif 674 #endif
674 } 675 }
675 676
676 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() { 677 bool ChromeContentClient::IsSupplementarySiteIsolationModeEnabled() {
677 #if defined(ENABLE_EXTENSIONS) 678 #if BUILDFLAG(ENABLE_EXTENSIONS)
678 return extensions::IsIsolateExtensionsEnabled(); 679 return extensions::IsIsolateExtensionsEnabled();
679 #else 680 #else
680 return false; 681 return false;
681 #endif 682 #endif
682 } 683 }
683 684
684 content::OriginTrialPolicy* ChromeContentClient::GetOriginTrialPolicy() { 685 content::OriginTrialPolicy* ChromeContentClient::GetOriginTrialPolicy() {
685 if (!origin_trial_policy_) 686 if (!origin_trial_policy_)
686 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); 687 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>();
687 return origin_trial_policy_.get(); 688 return origin_trial_policy_.get();
688 } 689 }
689 690
690 #if defined(OS_ANDROID) 691 #if defined(OS_ANDROID)
691 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { 692 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() {
692 return new ChromeMediaClientAndroid(); 693 return new ChromeMediaClientAndroid();
693 } 694 }
694 #endif // OS_ANDROID 695 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « chrome/common/DEPS ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698